SA-MP Forums Archive
Command /aod - 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: Command /aod (/showthread.php?tid=164697)



Command /aod - ScripterU - 01.08.2010

Hey I got a question /aod command ... How do I do when someone nicku as /aod to change .. For example ScripterU name and when I give /aod to appear ScripterU [ODA]. ... # Excuse my English are Rumanian

# /aod = admin on duty

Command:

new aodName[MAX_PLAYER_NAME];
if(strcmp(cmd, "/aod", true) == 0)
{
GetPlayerName(playerid, aodName, sizeof(playername));

if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(AdminDuty[playerid] == 1)
{
format(string, sizeof(string), "Admin %s[AOD] is no loger on Duty.", aodName);
SendClientMessageToAll(0x756FEEFF,string);
AdminDuty[playerid] = 0;
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
SetPlayerToTeamColor(playerid);
}
else
{
format(string, sizeof(string), "Admin %s is now on Duty.", aodName);
SendClientMessageToAll(0x8E4D31FF,string);
AdminDuty[playerid] = 1;
SetPlayerHealth(playerid,99999);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
SetPlayerToTeamColor(playerid);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Your not an admin !");
}
return 1;
}
}



Re: Command /aod - KennethRandall - 01.08.2010

Not possible for specified player as the function of SetPlayerName is:
pawn Код:
SetPlayerName(playerid, newname);