Issue with God Mode
#1

pawn Код:
CMD:zgod(playerid, params[])
{
    SetPlayerHealth(playerid, 99999);
    SetPlayerArmour(playerid, 99999);
    usergod = 1;
    GameTextForPlayer(playerid,"~w~GOD MODE: ~r~ON!",5000,5);
    return 1;
}
else if(usergod != 0)
{
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 0);
    usergod = 0;
    GameTextForPlayer(playerid,"~w~GOD MODE: ~r~OFF!",5000,5);
    return 1;
}
C:\Users\matt\Desktop\NG; LS-RP\gamemodes\gbrp.pwn(47) : error 010: invalid function or declaration
C:\Users\matt\Desktop\NG; LS-RP\gamemodes\gbrp.pwn(53) : error 010: invalid function or declaration
Reply
#2

This one should work:

PHP код:
CMD:zgod(playeridparams[])
{
    if(
usergod == 0)
    {
        
SetPlayerHealth(playerid99999);
        
SetPlayerArmour(playerid99999);
        
usergod 1;
        
GameTextForPlayer(playerid,"~w~GOD MODE: ~r~ON!",5000,5);
    }
    else if(
usergod == 1)
    {
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid0);
        
usergod 0;
        
GameTextForPlayer(playerid,"~w~GOD MODE: ~r~OFF!",5000,5);
    }
    return 
1;

You should return 1 at the end of the code like I did.
Reply
#3

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
This one should work:

PHP код:
CMD:zgod(playeridparams[])
{
    if(
usergod == 0)
    {
        
SetPlayerHealth(playerid99999);
        
SetPlayerArmour(playerid99999);
        
usergod 1;
        
GameTextForPlayer(playerid,"~w~GOD MODE: ~r~ON!",5000,5);
    }
    else if(
usergod == 1)
    {
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid0);
        
usergod 0;
        
GameTextForPlayer(playerid,"~w~GOD MODE: ~r~OFF!",5000,5);
    }
    return 
1;

You should return 1 at the end of the code like I did.
That's not godmode!
Try this:


PHP код:
#define INFINITY                (Float:0x7F800000)
CMD:zgod(playeridparams[])
{
    if(
usergod == 0)
    {
        
SetPlayerHealth(playeridINFINITY);
        
SetPlayerArmour(playeridINFINITY);
        
usergod 1;
        
GameTextForPlayer(playerid,"~w~GOD MODE: ~r~ON!",5000,5);
    }
    else if(
usergod == 1)
    {
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid0);
        
usergod 0;
        
GameTextForPlayer(playerid,"~w~GOD MODE: ~r~OFF!",5000,5);
    }
    return 
1;

Reply
#4

I edited his code since he wants the player's health to be set to 9999, and next time don't edit my code!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)