SA-MP Forums Archive
1 Error. - 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: 1 Error. (/showthread.php?tid=243077)



1 Error. - Davz*|*Criss - 21.03.2011

Hey Guys!

I have only one error i dunno how to fix it.

Please explain or fix it to me.

Thanks for your help


Sorry for 'Bold'!

The Error:-

pawn Код:
:\Users\Davz\Desktop\Server 2\gamemodes\Demonic.pwn(1502) : error 028: invalid subscript (not an array or too many subscripts): "i"
The Code:-

pawn Код:
CMD:slapall(playerid, params[])
{
    if (!IsPlayerAdmin(playerid)) return
        SendClientMessage(playerid, 0xFFFF00AA, "You're not an Adminstrator.");
       
    new Float:x, Float:y, Float:z;
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && (i != playerid)
        {
        PlayerPlaySound(i,1190,0.0,0.0,0.0);
        GetPlayerPos(i,x,y,z);
        SetPlayerPos(i,x,y,z+5);
    }
    return 1;
}



Re: 1 Error. - Vince - 21.03.2011

You forgot multiple brackets.

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (i != playerid))
{
PlayerPlaySound(i,1190,0.0,0.0,0.0);
GetPlayerPos(i,x,y,z);
SetPlayerPos(i,x,y,z+5);
}
}


Re: 1 Error. - Davz*|*Criss - 21.03.2011

Thanks, That what i was thinking but i thought it was wrong.

Thanks very much