[Ajuda] Gente, me ajudem. Como me refiro a um player pelo id?
#10

PHP Code:
CMD:trazer(playeridparams[])
{
     if(!
IsPlayerAdmin(playerid))
        return 
SendClientMessage(playerid0xFF0000FF"|ERRO| » Vocк nгo й um adm rcon!");
    new 
player1string[80];
    if(
sscanf(params"u"player1))
        return 
SendClientMessage(playerid0xFF0000FF"|USE| » /trazer [Playerid]");
    if(
player1 == INVALID_PLAYER_ID)
        return 
SendClientMessage(playerid0xFF0000FF"|ERRO| » O jogador nгo estб conectado.");
    if(
player1 == playerid)
        return 
SendClientMessage(playerid0xFF0000FF"|ERRO| » Vocк nгo pode usar este comando para si mesmo.");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    
SetPlayerInterior(player1GetPlayerInterior(playerid));
    
SetPlayerVirtualWorld(player1GetPlayerVirtualWorld(playerid));
    if(
GetPlayerState(player1) == 2)
    {
        new 
VehicleID GetPlayerVehicleID(player1);
        
SetVehiclePos(VehicleIDx+3yz);
        
LinkVehicleToInterior(VehicleIDGetPlayerInterior(playerid));
        
SetVehicleVirtualWorld(GetPlayerVehicleID(player1), GetPlayerVirtualWorld(playerid));
    }
    else 
SetPlayerPos(player1x+2yz);
    
format(stringsizeof(string), "Vocк foi teleportado para o Admin: \"%s\""GetPlayerNameEx(playerid));
    
SendClientMessage(player10xFFFF00FFstring);
    
format(stringsizeof(string), "Vocк teleportou o jogador \"%s\" para sua localizaзгo atual."GetPlayerNameEx(player1));
    
SendClientMessage(playerid0x00FF00FFstring);
    return 
1;
}
GetPlayerNameEx(playerid)
{
    new 
pname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
    return 
pname;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)