Why get errors ? - 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: Why get errors ? (
/showthread.php?tid=486383)
Why get errors ? -
barts - 08.01.2014
PHP код:
CMD:sprunk(playerid, params[])
{
new string[128];
if(IsPlayerCuffed(playerid) || IsPlayerInAnyVehicle(playerid) || IsPlayerTied(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "You can't do this right now.");
return 1;
}
if(!PlayerInfo[playerid][pSprunk]) return SendClientMessage(playerid, COLOR_GREY, "You don't have any sprunks on you.");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
PlayerInfo[playerid][pSprunk] --;
format(string, sizeof(string), "* %s takes out a sprunk can and opens it up.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
fuckensprunk[playerid] = 1;
return 1;
}
Error line:
PHP код:
fuckensprunk[playerid] = 1;
errors:
PHP код:
subscript (not an array or too many subscripts): "fuckensprunk"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one
line
Re: Why get errors ? -
offon - 08.01.2014
In the function SendNearbyMessage, why are there so many arguments (COLOR_PURPLE)? Is it supposed to be like that?
Re: Why get errors ? -
Voxel - 08.01.2014
On top of your script:
pawn Код:
new fuckensprunk[MAX_PLAYERS];
Re: Why get errors ? -
barts - 08.01.2014
Thanks Voxel
Re: Why get errors ? -
offon - 08.01.2014
Nothing against you, but after you made so many topics you should be able to define a simple variable.. Not just copy everything, you won't learn anything by doing so.