/orderweapon Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /orderweapon Help (
/showthread.php?tid=74817)
/orderweapon Help -
nickbugun - 26.04.2009
Код:
if(strcmp(cmdtext, "/orderweapon", true) == 0)
{
new tmp2[256];
GetPlayerTeam(playerid);
if(gTeam[playerid] == TEAM_Gundealer)
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
new gun = strval(tmp);
new ammo = strval(tmp2);
if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /orderweapon [ID] [Ammo]");
if(!strlen(tmp3)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /orderweapon [ID] [Ammo]");
GivePlayerWeapon(playerid, gun, ammo);
return 1;
}
It gives me these errors:
: error 003: declaration of a local variable must appear in a compound block
: error 017: undefined symbol "tmp2"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: fatal error 107: too many error messages on one line
where i have tmp = strtok(cmdtext, idx);