12.07.2011, 07:42
Hi guys, I'm currently trying to develop an admin duty command.
Here's what I got:
Everything works except when it gets the players name and stores it, then it sets it back, it sets it as something random like iIfjq1n.
Here's what I got:
Код:
new TempOldName[MAX_PLAYER_NAME];
if(strcmp(cmd,"/aduty",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "[System] You are not authorized to use that command !");
return 1;
}
if(AdminDutyStatus[playerid] == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"You are now on Admin Duty!");
AdminDutyStatus[playerid] = 1;
new name[MAX_PLAYER_NAME];
TempOldName[playerid] = GetPlayerName(playerid, name, sizeof(name));
SetPlayerName(playerid, GetPlayerFirstName(playerid));
//string
return 1;
}
else if(AdminDutyStatus[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"You have gone off Admin Duty!");
AdminDutyStatus[playerid] = 0;
SetPlayerName(playerid, PlayerInfo[playerid][TempOldName[playerid]]);
return 1;
}
return 1;
}


