Need help with Tazer command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with Tazer command (
/showthread.php?tid=326994)
Need help with Tazer command -
tallerin - 19.03.2012
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
Re: Need help with Tazer command -
Roel - 19.03.2012
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