SA-MP Forums Archive
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(playeridparams[])
{
    new 
string[128];
    if(
IsPlayerCuffed(playerid) ||  IsPlayerInAnyVehicle(playerid) || IsPlayerTied(playerid))
    {
        
SendClientMessage(playeridCOLOR_GREY"You can't do this right now.");
        return 
1;
    }
    if(!
PlayerInfo[playerid][pSprunk]) return SendClientMessage(playeridCOLOR_GREY"You don't have any sprunks on you.");
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_SPRUNK);
    
PlayerInfo[playerid][pSprunk] --;
    
format(stringsizeof(string), "* %s takes out a sprunk can and opens it up."RPN(playerid));
    
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
fuckensprunk[playerid] = 1;
    return 
1;

Error line:
PHP код:
fuckensprunk[playerid] = 1
errors:
PHP код:
 subscript (not an array or too many subscripts): "fuckensprunk"
warning 215expression has no effect
error 001
expected token";"but found "]"
error 029invalid expressionassumed 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.