How to teleport other player.... (Need help on other func. related to system)
#2

You could make a variable to store ids of challenger and challenged.
pawn Код:
new Challenge[MAX_PLAYERS] = { INVALID_PLAYER_ID, ... };
Once challenger challenges the challenged:
pawn Код:
Challenge[playerid] = challengedid;
Challenge[challengedid] = playerid;
If challenged clicks YES:
pawn Код:
if(Challenge[Challenge[playerid]] == playerid) //This checks if challenger hasnt challenged someone else while challenged was thinking
{
  SetPlayerPos(playerid, x, y, z);
  SetPlayerPos(Challenge[playerid], x, y, z);
  //When challenge ends, set both players Challenge to INVALID_PLAYER_ID;
}
else
{
  SendClientMessage(playerid, WHITE, "This player has challenged someone while you were thinking.");
  Challenge[playerid] = INVALID_PLAYER_ID;
}
if challenged clicks NO:
pawn Код:
if(Challenge[Challenge[playerid]] == playerid)
{
  SendClientMessage(Challenge[playerid], WHITE, "Challenge cancelled..");
  Challenge[Challenge[playerid]] = INVALID_PLAYER_ID;
  Challenge[playerid] = INVALID_PLAYER_ID;
}
else
{
  Challenge[playerid] = INVALID_PLAYER_ID;
}
Well you get the idea..
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)