01.08.2010, 14:37
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;
}
}
# /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;
}
}