01.06.2013, 06:05
I want to make if there are 2 players dueling in virtual world 10, and if 2 more wants to duel they should go in virtual world 11 and so on, so they don't disturb players dueling in virtual world 10, i don't know how to check there are players in virtual world 10 or not :\ can anyone help plz
And here's the /accept command
pawn Код:
new IsInDuel[MAX_PLAYERS];
new Dueler[MAX_PLAYERS];
pawn Код:
CMD:accept(playerid, params[])
{
new string[128];
if(IsInDuel[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Are Already in Duel!");
if(Dueler[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "No one has sent you a Duel Request.");
format(string, sizeof(string), "** %s (%d) Has Accepted Your Duel Request", GetName(playerid), playerid);
SendClientMessage(Dueler[playerid], COLOR_ORANGE, string);
format(string, sizeof(string), "You've Accepted %s (%d) Duel Request", GetName(Dueler[playerid]), Dueler[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "The Duel Between %s and %s Has Started!", GetName(Dueler[playerid]), GetName(playerid));
SendClientMessageToAll(COLOR_ORANGE, string);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
GetPlayerPos(Dueler[playerid], x, y, z);
SetPlayerInterior(playerid, 16);
SetPlayerInterior(Dueler[playerid], 16);
SetPlayerVirtualWorld(playerid, 10);
SetPlayerVirtualWorld(Dueler[playerid], 10);
SetPlayerPos(playerid, -1395.067, 1261.3706, 1042.8672);
SetPlayerPos(Dueler[playerid], -1395.067, 1261.3706, 1042.8672);
SetPlayerHealth(playerid, 100.0);
SetPlayerHealth(Dueler[playerid], 100.0);
SetPlayerArmour(playerid, 100.0);
SetPlayerArmour(Dueler[playerid], 100.0);
IsInDuel[playerid] = 1;
IsInDuel[Dueler[playerid]] = 1;
return 1;
}