Admin Duty - 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: Admin Duty (
/showthread.php?tid=496419)
Admin Duty -
Mriss - 22.02.2014
Well I kinda need an admin duty system this is the admin system thingo (cant explain it lol)
Код:
if(PlayerInfo[playerid][Admin] >= 1)
CMDs needed - /aduty , again to get off
/admins to show admins on duty I tried making one but failed... as usual :P
Re: Admin Duty -
ahmedkoki - 22.02.2014
You should use and remove to add "pAdminDuty" in enum pinfo
pawn Код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
SendClientMessage(playerid, 0xFFFF00AA, "You are now on administrative duty! Remember to check /reports!");
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
SetPlayerColor(playerid, 0xFF8C00AA);
new string[128];
format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are now off admin duty!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerToTeamColor(playerid);
PlayerInfo[playerid][pAdminDuty] = 0;
new string[128];
format(string, sizeof(string), "Administrator %s is now Off Admin Duty! ( Leave the Admin to Roleplay )", GetPlayerNameEx(playerid));
SendClientMessageToAll(0xFFFF00AA, string);
}
return 1;
}
Re: Admin Duty -
Mriss - 22.02.2014
Gimmie your colour defines :P
Re: Admin Duty -
ahmedkoki - 22.02.2014
Quote:
Originally Posted by Mriss
Gimmie your colour defines :P
|
I edited my post with the colors try now
Re: Admin Duty -
Mriss - 22.02.2014
The Colours arent there D:, Oh and btw, enjoy your +Rep from me
Re: Admin Duty -
Mriss - 22.02.2014
oh could you do so it pputs a Prefix infront of their name? like [CnR](ADMINS NAME HERE) but then removes the prefix?
Re: Admin Duty -
ahmedkoki - 22.02.2014
Try that
pawn Код:
CMD:aduty(playerid, params[])
{
new iadminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, iadminname, sizeof(iadminname));
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
SendClientMessage(playerid, 0xFFFF00AA, "You are now on administrative duty! Remember to check /reports!");
SetPlayerName(playerid, "[CnR] %s", iadminname);
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
SetPlayerColor(playerid, 0xFF8C00AA);
new string[128];
format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are now off admin duty!");
SetPlayerName(playerid, iadminname);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerToTeamColor(playerid);
PlayerInfo[playerid][pAdminDuty] = 0;
new string[128];
format(string, sizeof(string), "Administrator %s is now Off Admin Duty! ( Leave the Admin to Roleplay )", GetPlayerNameEx(playerid));
SendClientMessageToAll(0xFFFF00AA, string);
}
return 1;
}