Tipo, o meu /ir ta podendo ir mesmo sem tar em modo admin, queria q sу admin 3001 q nгo precisasse;
Код:
if(strcmp(cmd, "/ir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ir [id/nick]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
new string2[256];
new giveplayername[MAX_PLAYER_NAME];
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] > 49)
{
if(WatchingTV[plo] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Este administrador estб em modo de /tv e vocк nгo pode ir atй ele");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(PlayerInfo[plo][pInt] > 0)
{
XXAirBreak[playerid] += 3;
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
HouseEntered[playerid] = HouseEntered[plo];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(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)
{
XXAirBreak[playerid] += 3;
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
XXAirBreak[playerid] += 3;
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
XXAirBreak[playerid] += 3;SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(plo, giveplayername, sizeof(giveplayername));
format(string, sizeof(string), "*Admin %s foi ate %s", playername,giveplayername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string2, sizeof(string2), "*Admin %s veio ate %s", playername,giveplayername);
ProxDetector(30.0, plo, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return true;
}
}
if (PlayerInfo[playerid][pHelper] >= 50)
{
if(helpertrampando[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta em modo ajuda!");
return 1;
}
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(PlayerInfo[plo][pInt] > 0)
{
XXAirBreak[playerid] += 3;
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
HouseEntered[playerid] = HouseEntered[plo];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0)
{
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pInt] = 1;
}
if (GetPlayerState(playerid) == 2)
{
XXAirBreak[playerid] += 3;
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
XXAirBreak[playerid] += 3;
SetPlayerInterior(playerid,GetPlayerInterior(plo));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo));
XXAirBreak[playerid] += 3;SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
if(PlayerInfo[playerid][pHelper] >= 50 && helpertrampando[playerid] == 1)
{
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(plo, giveplayername, sizeof(giveplayername));
format(string, sizeof(string), "*Helper %s foi ate %s", playername,giveplayername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string2, sizeof(string2), "*Helper %s veio ate %s", playername,giveplayername);
ProxDetector(30.0, plo, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return true;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um admin ou helper 50+");
}
}
}
}
return 1;
}