Jump to content
  • 0

Question

Posted

Cand dau /gethere la un admin spune "Ask admin to goto you" , e normal dupa mine , dar cand dau /gethere la un player normal acelasi lucru . Ma puteti ajuta :) ?

5 answers to this question

Recommended Posts

Posted

OK : [pawn]//----------------------------------[GETHERE]-----------------------------------------------

if(strcmp(cmd, "/gethere", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [playerid/PartOfName]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

plo = ReturnUser(tmp);

if (IsPlayerConnected(plo))

{

    if(plo != INVALID_PLAYER_ID)

    {

if (PlayerInfo[plo][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 3)

{

SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");

return 1;

}

if (PlayerInfo[playerid][pAdmin] >= 1340)

{

GetPlayerPos(playerid, plocx, plocy, plocz);

if(PlayerInfo[playerid][pInt] > 0)

{

SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);

PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];

PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];

}

if(PlayerInfo[playerid][pInt] == 0)

{

SetPlayerInterior(plo,0);

}

if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8

{

SetPlayerInterior(plo,1);

PlayerInfo[plo][pInt] = 1;

}

if (GetPlayerState(plo) == 2)

{

TelePos[plo][0] = 0.0;

TelePos[plo][1] = 0.0;

new tmpcar = GetPlayerVehicleID(plo);

SetVehiclePos(tmpcar, plocx, plocy+4, plocz);

}

else

{

SetPlayerPos(plo,plocx,plocy+2, plocz);

}

SendClientMessage(plo, COLOR_GRAD1, "  You have been teleported");

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

}

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", plo);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Posted

incearca asa:

[pawn] if(strcmp(cmd, "/gethere", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [playerid/PartOfName]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

plo = ReturnUser(tmp);

if (IsPlayerConnected(plo))

{

    if(plo != INVALID_PLAYER_ID)

    {

if (PlayerInfo[plo][pAdmin] > 1340)

{

SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");

return 1;

}

if (PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pHelper] >= 3)

{

GetPlayerPos(playerid, plocx, plocy, plocz);

if(PlayerInfo[playerid][pInt] > 0)

{

SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);

PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];

PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];

}

if(PlayerInfo[playerid][pInt] == 0)

{

SetPlayerInterior(plo,0);

}

if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8

{

SetPlayerInterior(plo,1);

PlayerInfo[plo][pInt] = 1;

}

if (GetPlayerState(plo) == 2)

{

TelePos[plo][0] = 0.0;

TelePos[plo][1] = 0.0;

new tmpcar = GetPlayerVehicleID(plo);

SetVehiclePos(tmpcar, plocx, plocy+4, plocz);

}

else

{

SetPlayerPos(plo,plocx,plocy+2, plocz);

}

SendClientMessage(plo, COLOR_GRAD1, "  You have been teleported");

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

}

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", plo);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.