/aduty command - 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: /aduty command (
/showthread.php?tid=274776)
/aduty command -
DannySnoopy - 07.08.2011
Guys i am using the PRP GM, and i'v added a new /aduty command
it works. But the only problem is that, when i go on duty it changes to the skin i told it to change.
when i go off duty, it keeps the skin that on duty admin has, but i want it to return to the skin
that the player had BEFORE going on duty. here's the code
PHP код:
if(strcmp(cmd, "/aduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new msgstring[150];
if(PlayerInfo[playerid][pAdmin] > 0 && PlayerInfo[playerid][pAdminDuty] == 0)
{
format(PlayerInfo[playerid][pNormalName], 255, "%s", GetName(playerid));
//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
format(msgstring, sizeof(string), "{01A601}** Administrator %s is now on admin duty. (/askq for assistance) **",sendername);
SendClientMessageToAll(COLOR_WHITE, msgstring);
SetPlayerSkin(playerid, 240);
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 9999);
SetPlayerArmour(playerid, 9999);
}
else if(PlayerInfo[playerid][pAdmin] > 0 && PlayerInfo[playerid][pAdminDuty] != 0)
{
format(msgstring, sizeof(string), "{FF0000}** Administrator %s is now off admin duty. **",sendername);
SendClientMessageToAll(COLOR_WHITE, msgstring);
//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
}
}
return 1;
}
Re: /aduty command -
MadeMan - 07.08.2011
pawn Код:
if(strcmp(cmd, "/aduty", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] > 0)
{
new msgstring[150];
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
format(PlayerInfo[playerid][pNormalName], 255, "%s", GetName(playerid));
//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
format(msgstring, sizeof(string), "{01A601}** Administrator %s is now on admin duty. (/askq for assistance) **",sendername);
SendClientMessageToAll(COLOR_WHITE, msgstring);
SetPVarInt(playerid, "LastSkin", GetPlayerSkin(playerid));
SetPlayerSkin(playerid, 240);
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 9999);
SetPlayerArmour(playerid, 9999);
}
else
{
format(msgstring, sizeof(string), "{FF0000}** Administrator %s is now off admin duty. **",sendername);
SendClientMessageToAll(COLOR_WHITE, msgstring);
//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
SetPlayerSkin(playerid, GetPVarInt(playerid, "LastSkin"));
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
}
}
return 1;
}
Re: /aduty command -
DannySnoopy - 07.08.2011
Thanks a lot dude!!