public AtriDmStartTime() { new string[30]; DmEventCountDown--; if(DmEventCountDown == 30) { SendClientMessageToAll(0x00FF00FF, "[EVENT]: {FFFFFF}Only 30 seconds left, /join before event starts."); } for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInEvent[i] == true) { if(DmEventCountDown > 0) { format(string, sizeof(string), "Time Left: %d", DmEventCountDown); GameTextForPlayer(i, string, 5000, 3); } else if(DmEventCountDown == 0) { if(PlayersJoinedEvent <= 1) { SendClientMessageToAll(0xFF0000AA, "[EVENT]: {FFFFFF}The event has been cancled, Not enough players!"); IsPlayerInEvent[i] = false; PlayersJoinedEvent = 0; AtriDM = 0; SetPlayerHealth(i, 0); DmEventCountDown = 60; SetPlayerInterior(i, 0); DmEventTimerVar = SetTimer("DmEventT", 1800000, false); KillTimer(Event1SecT); } else if(PlayersJoinedEvent > 1 && IsPlayerInEvent[i] == true) { SendClientMessage(i, 0x00FF00AA, "[EVENT]: {FFFFFF}You have been unfrozen, be the last man standing to win the prize!"); TogglePlayerControllable(i,1); GameTextForPlayer(i, "~w~Event ~g~Started", 5000, 3); DmEventCountDown = 60; AtriDM = 2; KillTimer(Event1SecT); } } } } } return 1; }
for(new i = 0; i < MAX_PLAYERS; i++)
AtriDmStartTime()
PlayersJoinedEvent > 1 && IsPlayerInEvent[i] == true
public DmEventT()
{
SendClientMessageToAll(0x00FFFFAA, "[EVENT]: {FFFFFF}Atrium deathmatch event has started, type /join to take part!");
AtriHealthPickup[0] = CreateDynamicPickup(1240, 2, 1728.2104,-1668.2876,22.6094, -1, 18, -1, 100.0);
AtriHealthPickup[1] = CreateDynamicPickup(1240, 2, 1701.4614,-1648.4786,20.2194, -1, 18, -1, 100.0);
AtriArmourPickup[0] = CreateDynamicPickup(1242, 2, 1734.8628,-1639.2264,20.2307, -1, 18, -1, 100.0);
AtriArmourPickup[0] = CreateDynamicPickup(1242, 2, 1708.9303,-1677.3439,27.2016, -1, 18, -1, 100.0);
AtriAdrenalinePickup = CreateDynamicPickup(1241, 2, 1721.5195,-1672.7142,20.2234, -1, 18, -1, 100.0);
Event1SecT = SetTimer("AtriDmStartTime", 1000, true);
KillTimer(DmEventTimerVar);
AtriDM = 1;
return 1;
}
CMD:forcetevent(playerid, parmas)
{
if(PInfo[playerid][Admin] < 3) return SendClientMessage(playerid, RED,"[ERROR]: {FFFFFF}You do not have the privilleges to perform this command.");
DmEventT();
return 1;
}
forward DeathMatchStarter();
public DeathMatchStarter()
{
gDMCountdown -= 1;
if(gDMCountdown)
{
if(gDMCountdown == 30) //SendClientMessageToAll()
new str[30];
format(str, sizeof str, "Time left: %d", gDMCountdown);
//GameTextForAll
}
else
{
if(!gDMPlayers) // if players didnt join
{
SendClientMessageToAll(0xFF0000AA, "[EVENT]: {FFFFFF}The event has been cancled, Not enough players!");
foreach(new i : Player)
{
IsPlayerInEvent[i] = false;
PlayersJoinedEvent = 0;
AtriDM = 0;
SetPlayerHealth(i, 0);
DmEventCountDown = 60;
SetPlayerInterior(i, 0);
DmEventTimerVar = SetTimer("DmEventT", 1800000, false);
KillTimer(Event1SecT);
}
}
else // If players joined the event
{
foreach(new i : Player)
{
// code
}
}
}
return 1;
}
AtriArmourPickup[0] = CreateDynamicPickup(1242, 2, 1734.8628,-1639.2264,20.2307, -1, 18, -1, 100.0);
AtriArmourPickup[0] = CreateDynamicPickup(1242, 2, 1708.9303,-1677.3439,27.2016, -1, 18, -1, 100.0);
AtriArmourPickup[0] = CreateDynamicPickup(1242, 2, 1734.8628,-1639.2264,20.2307, -1, 18, -1, 100.0);
AtriArmourPickup[1] = CreateDynamicPickup(1242, 2, 1708.9303,-1677.3439,27.2016, -1, 18, -1, 100.0);
Dude don't delete the thread even if u got the help i was also typing a longass reply there its rude...
also show these : PHP код:
|
AtriDmStartTime()
PHP код:
PHP код:
|
CMD:join(playerid, parmas)
{
if(AtriDM == 0) return SendClientMessage(playerid, 0xFF0000AA, "[EVENT]: {FFFFFF}No event started yet!");
if(IsPlayerInEvent[playerid] == true) return SendClientMessage(playerid, 0xFF0000AA, "[EVENT]: {FFFFFF}You already joined the event be patience the event will start soon!");
if(AtriDM == 2) return SendClientMessage(playerid, 0xFF0000AA, "[EVENT]: {FFFFFF}This event already begun you cant join now!");
new Random = random(sizeof(AtriSpawns)), string[128];
SetPlayerPos(playerid, AtriSpawns[Random][0], AtriSpawns[Random][1], AtriSpawns[Random][2]);
SetPlayerFacingAngle(playerid, AtriSpawns[Random][3]);
SetPlayerInterior(playerid, 18);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, 0x00FF00AA, "[EVENT]: {FFFFFF}You have joined Atrium deathmatch event!");
format(string, sizeof(string), "[EVENT]: {FFFFFF}%s has joined the dm event, Type /join to enter it!", GetName(playerid));
SendClientMessageToAll(0x00FF00AA, string);
IsPlayerInEvent[playerid] = true;
PlayersJoinedEvent++;
ResetPlayerWeapons(playerid);
PlayerClass[playerid] = 0;
ChosenClass[playerid] = 0;
SetPlayerSkin(playerid, 294);
SetPlayerColor(playerid, 0xFFFFFFFF);
SetPlayerTeam(playerid, TEAM_NONE);
GivePlayerWeapon(playerid, 31, 100);
GivePlayerWeapon(playerid, 24, 50);
GivePlayerWeapon(playerid, 27, 40);
GivePlayerWeapon(playerid, 34, 10);
GivePlayerWeapon(playerid, 16, 1);
return 1;
}