Restoring last positions
#1

Hello Sa-Mp Brothers, I have a bit of a problem with my re-spawn command.
I want to do the thing when I spawn a player to restore his last position but I did not succeed can you bros help me with this command so sort it out Please ?

here is my command:

Код:
CMD:spawn(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	if(IsPlayerConnected(playerid))
	{
  		if (PlayerInfo[playerid][pAdmin] >= 1)
		{
			new id,sendername[30],giveplayer[30],string[256];
			if(sscanf(params, "u", id)) return SCM(playerid,COLOR_WHITE,"{FF9900}Scrie: {cef0ac}/spawn <Name/Playerid>");
			{
				if(IsPlayerConnected(id))
    			{
				    if(id != INVALID_PLAYER_ID)
    				{
						GetPlayerName(id, giveplayer, sizeof(giveplayer));
						SpawnPlayer(id);
						GetPlayerName(playerid, sendername, sizeof(sendername));
 						format(string, sizeof(string), "* Admin %s has spawn-ed you.", sendername);
						SendClientMessage(id, COLOR_IN2, string);
						format(string, sizeof(string), "You have respawned %s.", giveplayer);
						SendClientMessage(playerid, COLOR_IN2, string);
						format(string, sizeof(string), "AdmCmd: %s has /spawn-ed %s.",sendername, giveplayer);
						ABroadCast(COLOR_ADMCMD,string,1);
						HLChat(COLOR_ADMCMD,string);
						return 1;
					}
				}
                else
                {
                    SCM(playerid,COLOR_WHITE,"{FFFFCC}Error: Player not connected.");
                }
			}
   		}
		else
		{
			SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
		}
	}
	return 1;
}
Reply


Messages In This Thread
Restoring last positions - by Digii - 09.06.2016, 11:41
Re: Restoring last positions - by SyS - 09.06.2016, 12:13
Re: Restoring last positions - by Digii - 09.06.2016, 12:18
Re: Restoring last positions - by SyS - 09.06.2016, 12:38
Re: Restoring last positions - by Digii - 09.06.2016, 13:33
Re: Restoring last positions - by justjamie - 09.06.2016, 13:56
Re: Restoring last positions - by Digii - 09.06.2016, 14:55
Re: Restoring last positions - by Digii - 11.06.2016, 11:51
Re: Restoring last positions - by SyS - 11.06.2016, 11:54
Re: Restoring last positions - by Digii - 12.06.2016, 21:22

Forum Jump:


Users browsing this thread: 7 Guest(s)