29.08.2009, 17:41
Hey,
Iґve got a nice war mode, 30 players average. In every "country" thereґs a place enemy players can place a bomb. When this happens, a timer getґs activated and players are getting respawned. But, this timer is bugged somehow, you get respawned 5 times every 2 seconds.
Hereґs the code of the bomb putting:
And hereґs the code of the bomb activated:
Whatґs wrong?
Iґve got a nice war mode, 30 players average. In every "country" thereґs a place enemy players can place a bomb. When this happens, a timer getґs activated and players are getting respawned. But, this timer is bugged somehow, you get respawned 5 times every 2 seconds.
Hereґs the code of the bomb putting:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == usa)
{
if(GetPlayerTeam(playerid) == TEAM_Romania)
{
SendClientMessage(playerid,COLOR_YELLOW,"You're putting the bomb ! ");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0);
SetTimerEx("bombusa", 20000, false, "d", playerid);
SetTimerEx("bombeject", 15000, false, "d", playerid);
GameTextForAll("RUSSIA IS UNDER BOMB ATTACK!", 5000, 4);
}
if(GetPlayerTeam(playerid) == TEAM_Rusia)
{
SendClientMessage(playerid,COLOR_YELLOW,"You're putting the bomb ! ");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0);
SetTimerEx("bombusa", 20000, false, "d", playerid);
SetTimerEx("bombeject", 15000, false, "d", playerid);
GameTextForAll("RUSSIA IS UNDER BOMB ATTACK!", 5000, 4);
}
if(GetPlayerTeam(playerid) == TEAM_USA)
{
SendClientMessage(playerid,COLOR_YELLOW,"Defusing coming soon. ");
}
}
if(pickupid == rus)
{
if(GetPlayerTeam(playerid) == TEAM_Romania)
{
SendClientMessage(playerid,COLOR_YELLOW,"You're putting the bomb ! ");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0);
SetTimerEx("bombrus", 20000, false, "d", playerid);
SetTimerEx("bombeject", 15000, false, "d", playerid);
GameTextForAll("CHINA IS UNDER BOMB ATTACK!", 5000, 4);
}
if(GetPlayerTeam(playerid) == TEAM_USA)
{
SendClientMessage(playerid,COLOR_YELLOW,"You're putting the bomb ! ");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0);
SetTimerEx("bombrus", 20000, false, "d", playerid);
SetTimerEx("bombeject", 15000, false, "d", playerid);
GameTextForAll("CHINA IS UNDER BOMB ATTACK!", 5000, 4);
}
if(GetPlayerTeam(playerid) == TEAM_Rusia)
{
SendClientMessage(playerid,COLOR_YELLOW,"Defusing coming soon ");
}
}
if(pickupid == rom)
{
if(GetPlayerTeam(playerid) == TEAM_Rusia)
{
SendClientMessage(playerid,COLOR_YELLOW,"You're putting the bomb ! ");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0);
SetTimerEx("bombrom", 20000, false, "d", playerid);
SetTimerEx("bombeject", 15000, false, "d", playerid);
GameTextForAll("USA IS UNDER BOMB ATTACK!", 5000, 4);
}
if(GetPlayerTeam(playerid) == TEAM_USA)
{
SendClientMessage(playerid,COLOR_YELLOW,"You're putting the bomb ! ");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,0,0);
SetTimerEx("bombrom", 20000, false, "d", playerid);
SetTimerEx("bombeject", 15000, false, "d", playerid);
GameTextForAll("USA IS UNDER BOMB ATTACK!", 5000, 4);
}
if(GetPlayerTeam(playerid) == TEAM_Romania)
{
SendClientMessage(playerid,COLOR_YELLOW,"Defusing coming soon ");
}
}
}
Код:
forward bombusa(playerid);
public bombusa(playerid)
{
RemovePlayerFromVehicle(playerid);
CreateExplosion(-240.2157,2716.0264,62.6875, 7, 10.0);
GameTextForAll("USA Base Exploded", 3000, 4);
new pTeam=GetPlayerTeam(playerid);
new string[64];
format(string, sizeof(string),"~r~ Russia has lost the war!", pTeam);
GameTextForAll(string, 3000, 4);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
}
}
forward bombrus(playerid);
public bombrus(playerid)
{
RemovePlayerFromVehicle(playerid);
CreateExplosion(413.7413,2537.5007,19.1484, 7, 10.0);
GameTextForAll("Russia Base Exploded", 3000, 4);
new pTeam=GetPlayerTeam(playerid);
new string[64];
format(string, sizeof(string),"~r~ China has lost the war!", pTeam);
GameTextForAll(string, 3000, 4);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
}
}
forward bombrom(playerid);
public bombrom(playerid)
{
RemovePlayerFromVehicle(playerid);
CreateExplosion(241.5529,1860.2664,17.9121, 7, 10.0);
GameTextForAll("China Base Exploded", 3000, 4);
new pTeam=GetPlayerTeam(playerid);
new string[64];
format(string, sizeof(string),"~r~ USA has lost the war!", pTeam);
GameTextForAll(string, 3000, 4);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
}
}

