SA-MP Forums Archive
User GOD Mode Message not working - 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: User GOD Mode Message not working (/showthread.php?tid=414143)



User GOD Mode Message not working - UnknownGamer - 08.02.2013

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && usergod[issuerid] == 1)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "* Player has god mode.");
    }
    return 1;
}
Can someone fix this please, the vairable is usergod[MAX_PLAYERS]; When they go on god, it sets as usergod[playerid] = 1;

I want it to show a message to the shooter ID, when they shoot someone with GOD mode enabled. (This user has god mode). (THE USER YOUR SHOOTING HAS GOD MODE), basically to the shooter id, and not the player been shot.


Re: User GOD Mode Message not working - ]Rafaellos[ - 08.02.2013

Try using it like this:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(usergod[issuerid] == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "* Player has god mode.");
            return 1;
        }
    }
    return 1;
}



Re: User GOD Mode Message not working - SKAzini - 08.02.2013

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && usergod[playerid] == 1)
    {
        SendClientMessage(issuerid, COLOR_LIGHTRED, "* Player has god mode.");
    }
    return 1;
}