CMD? - 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: CMD? (
/showthread.php?tid=348656)
CMD? -
N0FeaR - 06.06.2012
Error
Код:
../gamemodes/OnPlayerCommandZCMD.pwn(2808) : error 046: unknown array size (variable "params")
pawn Код:
}
COMMAND:buyclothes(playerid, params[])
{
if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
if(IsAtClothShop(playerid))
{
params = strtok(params, idx);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE,"USAGE: /buyclothes [Skin ID]");
return 1;
}
if(GetPlayerMoney(playerid) < 200)
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough money ! ");
return 1;
}
new level = strval(params);
GivePlayerMoney(playerid,-200);
if(!IsValidSkin(level))
return SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!");
PlayerInfo[playerid][pSkin] = level;
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
}
return 1;
Re: CMD? -
Niko_boy - 06.06.2012
params = strtok(params, idx);
is invalid
just remove that
Re: CMD? -
Sandiel - 06.06.2012
You can't use strtok in ZCMD, I don't think so atleast...
It'll be confusing for you if you do, just use sscanf to define params.