15.11.2013, 14:57
pawn Код:
CMD:ir(playerid, params[])
{
//restriзгo de uso administrativo
if(!sscanf(params, "u", params[0]))
{
if(params[0] != INVALID_PLAYER_ID)
{
if(params[0] == playerid) return SendClientMessage(playerid, -1, # Vocк nгo pode dar-se );
new Float:p_x,Float:p_y,Float:p_z;
new interior = GetPlayerInterior(params[0]);
new world = GetPlayerVirtualWorld(params[0]);
GetPlayerPos(params[0], p_x,p_y,p_z);
SetPlayerPos(playerid,p_x,p_y,p_z);
SetPlayerVirtualWorld(playerid,world);
SetPlayerInterior(playerid,interior);
return SendClientMessage(playerid, -1, # Teleportado);
} else SendClientMessage(playerid, -1, # Jogador nгo estб conectado.);
} else SendClientMessage(playerid, -1, # Usar: /ir <PlayerID>);
return 1;
}
if(strcmp(cmd, "/ir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, # Usar: /ir <PlayerID>);
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
//restriзгo de uso administrativo
GetPlayerPos(plo, plocx, plocy, plocz);
new interior = GetPlayerInterior(plo);
new world = GetPlayerVirtualWorld(plo);
if(GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
SetPlayerVirtualWorld(playerid,world);
SetPlayerInterior(playerid,interior);
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
SetPlayerVirtualWorld(playerid,world);
SetPlayerInterior(playerid,interior);
}
SendClientMessage(playerid, -1, # Teleportado);
}
}
else
{
SendClientMessage(playerid, -1, # Jogador nгo estб conectado.);
}
}
return 1;
}