If Get Player health >100
#6

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Godmode:

Top of script:
pawn Код:
new GodMode[MAX_PLAYERS];
An example of how you could do it:

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(GodMode[damagedid] = 1); // If godmode = true for damagedid (victim)
    {
        GameTextForPlayer(playerid, "~r~This player is godmodded! You can not attack him!", 5000, 0); // Send this message to playerid (attacker)
        return 1;
    }
    return 1;
}
An example of how it could look with zCMD: (Not tested, just done an all nighter so it is most likely messed up, but you get the idea).

pawn Код:
CMD:godmode(playerid, params[])
{
    if(GodMode[playerid] < 1);
    {
        SendClientMessage(playerid, -1, "Godmode turned on!");
        GodMode[playerid] = 1;
        // Code here (for health or w/e)
        return 1;
    }
    else if(GodMode[playerid] > 0);
    {
        GodMode[playerid] = 0;
        SendClientMessage(playerid, -1, "Godmode turned off!");
        // Remove that code here if you want
        return 1;
    }
    return 1;
}
AFK checker:

Top of script:
pawn Код:
new IsAFK[MAX_PLAYERS];
Coming straight from SA-MP wiki:

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    if(IsAFK[playerid] < 1)
    {
        new message[32];

        format(message, sizeof(message), "Player %d is AFK!", clickedplayerid);
        SendClientMessage(playerid, -1, message);
        return 1;
    }
    return 1;
}
zCMD example again:

pawn Код:
CMD:afk(playerid, params[])
{
    if(IsAFK[playerid] < 1);
    {
        SendClientMessage(playerid, -1, "You have gone AFK!");
        IsAFK[playerid] = 1;
        // Code here (for health or w/e)
        return 1;
    }
    else if(GodMode[playerid] > 0);
    {
        IsAFK[playerid] = 0;
        SendClientMessage(playerid, -1, "You have returned!");
        // Remove that code here if you want
        return 1;
    }
    return 1;
}
Код:
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\DAdmin2.pwn(5700) : error 017: undefined symbol "GodMode"
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\DAdmin2.pwn(5700) : warning 215: expression has no effect
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\DAdmin2.pwn(5700) : error 001: expected token: ";", but found "]"
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\DAdmin2.pwn(5700) : error 029: invalid expression, assumed zero
C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\DAdmin2.pwn(5700) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Messages In This Thread
If Get Player health >100 - by MahdiGames - 12.01.2014, 23:13
Re: If Get Player health >100 - by Kirollos - 13.01.2014, 00:15
Re: If Get Player health >100 - by xZdadyZx - 13.01.2014, 06:03
Re: If Get Player health >100 - by Dignity - 13.01.2014, 07:45
Re: If Get Player health >100 - by MahdiGames - 13.01.2014, 07:46
Re: If Get Player health >100 - by MahdiGames - 13.01.2014, 07:51
Re: If Get Player health >100 - by Dignity - 13.01.2014, 07:52
Re: If Get Player health >100 - by MahdiGames - 13.01.2014, 07:55
Re: If Get Player health >100 - by Dignity - 13.01.2014, 07:57
Re: If Get Player health >100 - by MahdiGames - 13.01.2014, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)