SA-MP Forums Archive
[Help]invulnerable adm - 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: [Help]invulnerable adm (/showthread.php?tid=132875)



[Help]invulnerable adm - keller012 - 09.03.2010

I wanted to make a system where the stay invulnerable adm ...
but it did not gave alquem can help me?

Quote:

if(strcmp(cmd, "/adm", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
GetPlayerName(playerid, sMsg, MAX_PLAYER_NAME);
format( sMsg, sizeof( sMsg ), "* %s is now connected to a moderator.", sMsg );
SendClientMessageToAll( TEAM_BLUE_COLOR, sMsg );
SetPlayerColor(playerid,TEAM_BLUE_COLOR);
LigarAdmin[playerid] = 1;
SetPlayerArmour(playerid, 10000000);
}
else if(PlayerInfo[playerid][pAdmin] >= 5)
{
GetPlayerName(playerid, sMsg, MAX_PLAYER_NAME);
format( sMsg, sizeof( sMsg ), "* %s is now connected as an administrator.", sMsg );
SendClientMessageToAll( COLOR_YELLOW, sMsg );
SetPlayerColor(playerid,COLOR_YELLOW);
LigarAdmin[playerid] = 0;
SetPlayerArmour(playerid, 1000000);
SetPlayerHealth(playerid, 1000000);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not an administrator!.");
return 1;
}
}
return 1;
}




Re: [Help]invulnerable adm - DjSterios - 10.03.2010

What's exatcly your problem? they are not invulnerable? If they are not, try to make a timer, first of all:

Код:
Forward AdminInv(playerid);

new AdminInvTimer;

on Gamemode init:
AdminInvTimer = SetTimer("AdminInv", 1000, 1);

public AdminInv(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
		{
              if(PlayerInfo[playerid][pAdmin] >= 1)
              {
                   SetPlayerArmour(i, 10000);
                   SetPlayerHealth(i, 10000);
              }
         }
}
Try this.
BTW i haven't tested it, but it will work i hope XD (and put the lines in the correct order, difficult to make it in the forum :P)
(Also with this, admin will be ALL the time invulnerable, if u want to make it with command, you can modify it, if you dont know how, ask me )Test it, and let me know.(reply)