09.02.2019, 21:53
PHP Code:
CMD:trazer(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFF0000FF, "|ERRO| » Vocк nгo й um adm rcon!");
new player1, string[80];
if(sscanf(params, "u", player1))
return SendClientMessage(playerid, 0xFF0000FF, "|USE| » /trazer [Playerid]");
if(player1 == INVALID_PLAYER_ID)
return SendClientMessage(playerid, 0xFF0000FF, "|ERRO| » O jogador nгo estб conectado.");
if(player1 == playerid)
return SendClientMessage(playerid, 0xFF0000FF, "|ERRO| » Vocк nгo pode usar este comando para si mesmo.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerInterior(player1, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(player1, GetPlayerVirtualWorld(playerid));
if(GetPlayerState(player1) == 2)
{
new VehicleID = GetPlayerVehicleID(player1);
SetVehiclePos(VehicleID, x+3, y, z);
LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(player1), GetPlayerVirtualWorld(playerid));
}
else SetPlayerPos(player1, x+2, y, z);
format(string, sizeof(string), "Vocк foi teleportado para o Admin: \"%s\"", GetPlayerNameEx(playerid));
SendClientMessage(player1, 0xFFFF00FF, string);
format(string, sizeof(string), "Vocк teleportou o jogador \"%s\" para sua localizaзгo atual.", GetPlayerNameEx(player1));
SendClientMessage(playerid, 0x00FF00FF, string);
return 1;
}
GetPlayerNameEx(playerid)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
return pname;
}