Author Topic: Armour Command Help  (Read 4043 times)

0 Members and 2 Guests are viewing this topic.

Offline nikobg

  • Street Thug
  • *
  • Posts: 9
    • View Profile
Armour Command Help
« on: December 16, 2012, 02:13:09 pm »
I am new to pawn scripting and i am currently trying to make an armour command...
[pawn]   else if ( strcmp( cmd, "!protect", true ) == 0 )
   {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      new Float:armour; GetPlayerArmour(playerid,armour);
      if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
      else
      {
            if(CheckMoney(playerid, 500);
          {
             SetPlayerArmour(playerid, 100);
             DecPlayerHandCash(playerid, 500);
             SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
      }
      return 1;
      
      }[/pawn]
but i am doing something wrong because I can't compile because of it.And i have no idea what i am doing wrong.
here are the 26 errors
Quote
C:\Users\niko\Desktop\gamemode\Niko.pwn(212) : error 017: undefined symbol "CompariseIp"
C:\Users\niko\Desktop\gamemode\Niko.pwn(230) : error 017: undefined symbol "StatusTag"
C:\Users\niko\Desktop\gamemode\Niko.pwn(400) : error 017: undefined symbol "DecPlayerHandCash"
C:\Users\niko\Desktop\gamemode\Niko.pwn(401) : error 017: undefined symbol "IncPlayerDeaths"
C:\Users\niko\Desktop\gamemode\Niko.pwn(417) : error 017: undefined symbol "IncPlayerHandCash"
C:\Users\niko\Desktop\gamemode\Niko.pwn(418) : error 017: undefined symbol "IncPlayerKills"
C:\Users\niko\Desktop\gamemode\Niko.pwn(422) : error 017: undefined symbol "DecPlayerHandCash"
C:\Users\niko\Desktop\gamemode\Niko.pwn(423) : error 017: undefined symbol "IncPlayerDeaths"
C:\Users\niko\Desktop\gamemode\Niko.pwn(541) : error 017: undefined symbol "LoadSkins"
C:\Users\niko\Desktop\gamemode\Niko.pwn(542) : error 017: undefined symbol "LoadSpawnCharacters"
C:\Users\niko\Desktop\gamemode\Niko.pwn(543) : error 017: undefined symbol "LoadVehicles"
C:\Users\niko\Desktop\gamemode\Niko.pwn(544) : error 017: undefined symbol "LoadPickups"
C:\Users\niko\Desktop\gamemode\Niko.pwn(545) : error 017: undefined symbol "SetServerConfiguration"
C:\Users\niko\Desktop\gamemode\Niko.pwn(563) : error 017: undefined symbol "InitWepList"
C:\Users\niko\Desktop\gamemode\Niko.pwn(595) : error 017: undefined symbol "IsLoggedIn"
C:\Users\niko\Desktop\gamemode\Niko.pwn(603) : error 017: undefined symbol "encrypt"
C:\Users\niko\Desktop\gamemode\Niko.pwn(631) : error 017: undefined symbol "IsRegistered"
C:\Users\niko\Desktop\gamemode\Niko.pwn(632) : error 017: undefined symbol "IsLoggedIn"
C:\Users\niko\Desktop\gamemode\Niko.pwn(637) : error 017: undefined symbol "encrypt"
C:\Users\niko\Desktop\gamemode\Niko.pwn(655) : error 017: undefined symbol "UpDateFile"
C:\Users\niko\Desktop\gamemode\Niko.pwn(656) : error 017: undefined symbol "UpDateFile"
C:\Users\niko\Desktop\gamemode\Niko.pwn(661) : error 017: undefined symbol "StatusTag"
C:\Users\niko\Desktop\gamemode\Niko.pwn(694) : error 017: undefined symbol "UpDateFile"
C:\Users\niko\Desktop\gamemode\Niko.pwn(712) : error 017: undefined symbol "FindPlayerIDFromString"
C:\Users\niko\Desktop\gamemode\Niko.pwn(714) : error 017: undefined symbol "IsLoggedIn"
C:\Users\niko\Desktop\gamemode\Niko.pwn(715) : error 017: undefined symbol "IsAuthorized"

Compilation aborted.Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


26 Errors.
i also want to make it to decrease a player's hand cash by 500$ and if he doesnt have enough money to tell him "You don't have 500$"
i would appreciate if someone gives me a vcmp pawn wiki
« Last Edit: December 16, 2012, 02:16:41 pm by nikobg »

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Armour Command Help
« Reply #1 on: December 16, 2012, 02:45:34 pm »
In your script are a lot of undefined functions.

You maybe forget to add them.

Anyway, I will present you the VC:MP Pawn Wiki:
http://thijn.vrocker-hosting.co.uk/VCWiki/index.php/Main_Page

VC:MP Pawn Wiki , he is nikobg
nikobg , it is VC:MP Pawn Wiki.

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline nikobg

  • Street Thug
  • *
  • Posts: 9
    • View Profile
Re: Armour Command Help
« Reply #2 on: December 16, 2012, 02:52:01 pm »
but can you atleast tell me how to make it work?

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Armour Command Help
« Reply #3 on: December 16, 2012, 03:43:38 pm »
but can you atleast tell me how to make it work?

You use the GUPS Database right ?

When you copy some cmds like /c register , /c login , /c buyprop , /c buyveh etc. you have to copy the whole script.

Open the gups gamemode and search all functions you got error like:
Code: [Select]
CompariseIp, StatusTag, UpDataFile etc.
Anyway, the compiler have a maximum of 26 errors shown, so you can have more than 26.

Just do what I told you , and after you copied all functions, try to compile.

All function have to be something like this:

Code: [Select]
stock <NameOfFunction> (<VariablesOfFunction>)
{
 //script
}

or

Code: [Select]
public <NameOfFunction> (<VariablesOfFunction>)
{
 //script
}

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline nikobg

  • Street Thug
  • *
  • Posts: 9
    • View Profile
Re: Armour Command Help
« Reply #4 on: December 16, 2012, 04:26:39 pm »
dafuq did i just read...anyways i give up.I'll just make it SetPlayerArmour ( playerid, 100 )
end of story (i dont understand sh*t)

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Armour Command Help
« Reply #5 on: December 16, 2012, 04:58:01 pm »
dafuq did i just read...anyways i give up.I'll just make it SetPlayerArmour ( playerid, 100 )
end of story (i dont understand sh*t)

All errors aren't made by only "!repair" command.

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline · KaTaNNa ·

  • Street Thug
  • *
  • Posts: 12
  • It's easy to talk about difficult mi.Lo is be me .
    • View Profile
Re: Armour Command Help
« Reply #6 on: December 25, 2012, 05:23:27 pm »
Well, you have several errors that I could correct them. Why not try to use this cmd?

[pawn]else if ( strcmp( cmd, "!protect", true ) == 0 )
   {
   new dinero,Float:armour;dinero = GetPlayerMoney(playerid),Float:armour = GetPlayerArmour(playerid,armour);
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );      
      else if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
      else if(dinero < 500) SendClientMessage(playerid,COLOR_GREEN,"Need $ 10 for your protection");
      else
      {
  if(dinero >= 500) {      
  SetPlayerArmour(playerid, 100.0);
  DecPlayerHandCash(playerid, 500);
  SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
      }
  }
      return 1;      
      }[/pawn]

Ok, I'll tell you had your error in your cmd.

[pawn]else if ( strcmp( cmd, "!protect", true ) == 0 )
   {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      new Float:armour; GetPlayerArmour(playerid,armour);
      if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
      else
      {
            if(CheckMoney(playerid, 500);//here in an "if" never going this symbol ";"
          {
             SetPlayerArmour(playerid, 100);
             DecPlayerHandCash(playerid, 500);
             SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
      }//The other problem was that you needed to use another "arm", or as you call it, like this "}"
             }//to make it so ...
      return 1;      
      }[/pawn]

I hope you served. Sorry for my "bad English"
If you think you do dificil.No back ... go ahead and face it! ;D

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Armour Command Help
« Reply #7 on: December 27, 2012, 06:25:44 pm »
use this it is work in gups and every script
just remove that timer
if check money
[pawn]   else if ( strcmp( cmd, "!protect", true ) == 0 )
   {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      new Float:armour; GetPlayerArmour(playerid,armour);
      if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
      else
      {
             SetPlayerArmour(playerid, 100);
             DecPlayerHandCash(playerid, 500);
             SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
      }
      return 1;
      }[/pawn]
here i use it good cmd
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol