Quote:
Originally Posted by Nero_3D
Lets stip that code to the important parts
pawn Код:
//offertp Offer[Player][0] = playerid; Offer[playerid][0] = Player; //accepttp for(new i = 0; i < cfg_SERVER_MAXPLAYERS; i++) { if(Offer[playerid][0] == Offer[i][0]) { GetPlayerPos(i, AdminPosition[0], AdminPosition[1], AdminPosition[2]); SetPlayerPos(playerid, AdminPosition[0], AdminPosition[1], AdminPosition[2]); Offer[playerid][0] = -1; Offer[i][0] = -1; } }
So Offer[x] = y; and Offer[y] = x;
Alright now we loop through all players
And check if Offer[x] (which is y) is the same as Offer[i]
So this condition is only fulfilled if two players got an offer by y
And if its fulfilled than it teleports the command user to the other player who got an offer
pawn Код:
//offertp Offer[Player][0] = playerid; //accepttp GetPlayerPos(Offer[playerid][0], AdminPosition[0], AdminPosition[1], AdminPosition[2]); SetPlayerPos(playerid, AdminPosition[0], AdminPosition[1], AdminPosition[2]); Offer[playerid][0] = -1;
|
Thank you very much -- Shortened my command by quite a bit aswell.