All pastes #366518 Raw Edit

Someone

public text v1 · immutable
#366518 ·published 2007-02-21 18:49 UTC
rendered paste body
command_teleport(playerid, cmdtext[])
{
   	new teleid[256], index;
   	teleid = strtok(cmdtext, index);
   	if(!strlen(teleid))
	{
   		SendErrMsg(playerid, "Usage: /teleport <ID/Name>");
   	}
   	else
   	{
		new Float:x, Float:y, Float:z, carid;
		GetPlayerPos(strval (teleid), x, y, z);
		carid = GetPlayerVehicleID(playerid);
		if (!IsPlayerInAnyVehicle(playerid))
		{
			SetVehiclePos(carid, x, y, z + 4);
			SetCameraBehindPlayer(playerid);
		}
		else
		{
			SetPlayerPos(playerid, x, y, z + 4);
			SetCameraBehindPlayer(playerid);
	        }
	}
	new telename[MAX_PLAYER_NAME];
	GetPlayerName(strval(teleid), telename, MAX_PLAYER_NAME);
	new string[256];
	format(string, sizeof(string),"You have been teleported to %s", telename);
	SendInfMsg(playerid, string);
	new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	new string2[256];
	format(string2, sizeof(string2),"%s has teleported to you", playername);
	SendInfMsg(strval(teleid), string2);
	TakePlayerMoney(playerid, 150000);
	}
	return 1;
}