10.05.2011, 14:51
Lets stip that code to the important parts
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;
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;
}
}
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;