24.06.2011, 11:31
(
Последний раз редактировалось liinor; 07.05.2013 в 18:47.
Причина: Can be deleted
)
Can be deleted
new DualStarted;
new DualJoin;
new Dualers[2];
public OnGameModeInit()
{
Dualers[0] = -1;
Dualers[1] = -1;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/dual", cmdtext, true))
{
if(DualStarted == 1) return SendClientMessage(playerid, 0xFF0000AA, "There is already a dual running!");
if(DualJoin == 0)
{
SendClientMessageToAll(0x1229FAFF, "The Dual arena has been started!");
SetPlayerPos(playerid, /*XPOS*/, /*YPOS*/, /*ZPOS*/);
GivePlayerWeapon(playerid, /*WeaponID*/, /*Amo*/);
Dualers[0] = playerid;
DualJoin = 1;
return 1;
}
if(DualJoin == 1)
{
SendClientMessageToAll(0x1229FAFF, "The Dual has been started!");
SetPlayerPos(playerid, /*XPOS*/, /*YPOS*/, /*ZPOS*/);
GivePlayerWeapon(playerid, /*WeaponID*/, /*Amo*/);
DualStarted = 1;
Dualers[1] = playerid;
}
return 1;
}
return 0;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new str[70];
if(playerid == Dualers[0])
{
DualStarted = 0;
SpawnPlayer(Dualers[1]);
new Pname[24];
GetPlayerName(Dualers[1], Pname, sizeof(Pname));
format(str, sizeof(str), "%s has won the dual!", Pname);
SendClientMessageToAll(0x1229FAFF, str);
Dualers[0] = -1;
Dualers[1] = -1;
}
if(playerid == Dualers[1])
{
DualStarted = 0;
SpawnPlayer(Dualers[0]);
new Pname[24];
GetPlayerName(Dualers[0], Pname, sizeof(Pname));
format(str, sizeof(str), "%s has won the dual!", Pname);
SendClientMessageToAll(0x1229FAFF, str);
Dualers[0] = -1;
Dualers[1] = -1;
}
return 1;
}