Need help with Tazer command
#1

I'm trying to put a tazer command into my gamemode but i'm haveing some issues

Heres the command

Код:
command(tazer, playerid, params[])
{
    if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, WHITE, "You can't use this command while in a car!");
            return 1;
        }
        if(pTazer[playerid] == 0)
        {
            GivePlayerWeaponEx(playerid, 23);
            new string[128];
            format(string, sizeof(string), "* %s takes out a Tazer from his utility belt turning the safety OFF. *", (playerid));
			NearByMessage(playerid, PINK, string);
            pTazer[playerid] = 1;
            return 1;
        }
        else if(pTazer[playerid] == 1)
        {
            RemoveItems(playerid, 23);
            new string[128];
            format(string, sizeof(string), "* %s places a Tazer into his utility belt turning the safety ON. *", (playerid));
			NearByMessage(playerid, PINK, string);
            //GivePlayerWeaponEx(playerid, 24);
            return 1;
		}
    }
    return 1;
}
Heres the error I get

Код:
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : error 017: undefined symbol "RemoveItems"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
I tryed adding it as
New RemoveItems but i get this

Код:
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : error 012: invalid function call, not a valid address
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : warning 215: expression has no effect
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : warning 215: expression has no effect
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : error 001: expected token: ";", but found ")"
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : error 029: invalid expression, assumed zero
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
I tryed adding it as
#define RemoveItems and i get this

Код:
C:\Users\Tallerin\Desktop\BKRP\gamemodes\BK-RP.pwn(27221) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
If i comment that line out it complies great and the first part of the command works. When you do /tazer it gives it to you and when you do /tazer again it puts it away. But thats theonly time it works as if you do /tazer for 3rd time it says soandso places a Tazer into his utility belt turning the safety ON its this for evertime the comand is used after the 2nd time.

Anyhelp for a begginer would be appreciated
Reply
#2

RemoveItems(playerid, 23);

is a function, probably a public function which you have to create with 'forward'
But I don't know where you found this command but somewhere in there should also be the function: RemoveItems
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)