pawn Код:
CMD:ir(playerid, params[])
{
new id;
new interior = GetPlayerInterior(id);
new Float: x, Float: y, Float: z;
if(sscanf(params, "u", id) ) return SendClientMessage(playerid, 0xFFFFFFFF, "Digite: /ir id.");
GetPlayerPos(id, x, y, z);
SetPlayerInterior(playerid, interior);
SetPlayerPos(playerid, x, y, z);
return 1;
}
Код:
// no topo do gm
new Spectate[MAX_PLAYERS];
if(strcmp(cmd, "/ir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BRANCO, "[Info] USO: /ir [playerid/Parte-do-Nick]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
new nome[24];
GetPlayerName(playerid, nome, sizeof nome);
if(PlayerInfo[playerid][pAdmin] >= 1 || strfind(nome, ADMPLAYER, true) == 0 || strfind(nome, ADMPLAYER2, true) == 0)
{
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(PlayerInfo[plo][pInt] > 0)
{
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(playerid,0);
}
if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pInt] = 1;
}
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
GetPlayerName(plo, giveplayer,256);
GetPlayerName(playerid, sendername,256);
format(string, sizeof(string), "[Info] Vocк teleportou atй %s.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "[Info] O admin %s, teleportou atй vocк.", sendername);
SendClientMessage(plo, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando\\ ou nгo estб com admin ligado !");
}
}
}
else
{
format(string, sizeof(string), " %d nгo й um player ativo.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}