Get player name > temp store
#1

Hi guys, I'm currently trying to develop an admin duty command.

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;
	}
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.
Reply


Messages In This Thread
Get player name > temp store - by Jack_Leslie - 12.07.2011, 07:42
Re: Get player name > temp store - by Toreno - 12.07.2011, 07:48
Re: Get player name > temp store - by Jack_Leslie - 12.07.2011, 07:49
Re: Get player name > temp store - by PrawkC - 12.07.2011, 07:50
Re: Get player name > temp store - by Toreno - 12.07.2011, 07:52
Re: Get player name > temp store - by Jack_Leslie - 12.07.2011, 07:53
Re: Get player name > temp store - by PrawkC - 12.07.2011, 07:54
Re: Get player name > temp store - by Jack_Leslie - 12.07.2011, 07:56
Re: Get player name > temp store - by Toreno - 12.07.2011, 08:19
Re: Get player name > temp store - by Jack_Leslie - 12.07.2011, 09:03

Forum Jump:


Users browsing this thread: 1 Guest(s)