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



Little Error - Rock_Ro - 18.06.2011

pawn Код:
new GodMode[ MAX_PLAYERS ];
#if defined Use_DW_Rcon_Admin_System
CMD:rgod( playerid, params[ ] )
{
    CheckRconAdmin( playerid );
   
    if( GodMode == 0 )
    {
        SetPlayerHealth( playerid, 99999 );
        SendClientMessage( playerid, COLOR_WHITE, "God Mode Activated.");
    }
    else if( GodMode == 1 )
    {
        SetPlayerHealth( playerid, 100 );
        SendClientMessage( playerid, COLOR_WHITE, "God Mode Deactivated.");
    }
    return 1;
}
#endif
Код:
C:\Documents and Settings\Mureseanu\My Documents\Altele\Rock's Server\gamemodes\--.pwn(166) : error 033: array must be indexed (variable "GodMode")
C:\Documents and Settings\Mureseanu\My Documents\Altele\Rock's Server\gamemodes\--.pwn(171) : error 033: array must be indexed (variable "GodMode")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: Little Error - WooTFTW - 18.06.2011

pawn Код:
CMD:rgod( playerid, params[ ] )
{
    CheckRconAdmin( playerid );
   
    if( GodMode[playerid] == 0 )
    {
        SetPlayerHealth( playerid, 99999 );
        SendClientMessage( playerid, COLOR_WHITE, "God Mode Activated.");
    }
    else if( GodMode[playerid] == 1 )
    {
        SetPlayerHealth( playerid, 100 );
        SendClientMessage( playerid, COLOR_WHITE, "God Mode Deactivated.");
    }
    return 1;
}
Should work


Re: Little Error - Rock_Ro - 18.06.2011

Thanks.

So simple...