14.12.2013, 04:31
when i put this code in the gamemode here i get many errors?
pls fix
gamemode : http://www.solidfiles.com/d/df0b725c92/
the code i entered:-
public OnPlayerEnterDynamicCP(playerid, checkpointid)
if(checkpointid == PlantbombCP)
{
if(AllTeams[playerid] == ARMY && (BombPlanted == 1))
{
DefuseTimer = SetTimerEx("DefuseBomb", 10000, false, "is", playerid);
Defusing = 1;
GameTextForAll("~b~Army is trying to defuse the bomb!!~n~~r~Terrorists, Try to stop them!", 3000, 3);
return 1;
}
else return 0;
}
forward DefuseBomb(playerid);
public DefuseBomb(playerid)
{
if(Defusing == 1)
{
KillTimer(DefuseTimer);
KillTimer(BombExplodeTimer);
KillTimer(ExplodeBomb[playerid]);
GameTextForAll("Army successfully defused the bomb!", 3000, 3);
GivePlayerMoney(playerid, 10000);
Defusing = 0;
BombPlanted = 0;
DestroyObject(Bomb);
SetPlayerScore(playerid, GetPlayerScore(playerid) +10);
SendClientMessage(playerid, COLOR_GREEN, "you earned {FF0000}$10000 {00FF00}and {FF0000}10 score {00FF00}for defusing the bomb");
return 1;
}
return 1;
CMD: plantbomb(playerid, params[])
{
if(IsPlayerInDynamicCP(playerid, PlantbombCP) && (AllTeams[playerid] == TERRORISTS && (BombPlanted == 0)))
{
Bomb = CreateObject(3786,259.2780,1855.8953,8.7578,196.86 89,0,0, 100.0);
BombExplodeTimer = SetTimer("BombExplodes", 110000, 0);
GameTextForAll("~r~Terrorists planted a bomb in ~b~Army base~n~~g~army try to defuse it~n~ ~r~stand in checkpoint for 10 seconds to defuse it!", 4000, 3);
BombPlanted = 1;
}
else if(IsPlayerInDynamicCP(playerid, PlantbombCP) && (AllTeams[playerid] == TERRORISTS && (BombPlanted != 0))) return SendClientMessage(playerid, COLOR_RED, "The bomb is already planted!");
return 1;
}
forward BombExplodes(playerid);
public BombExplodes(playerid)
{
GameTextForAll("Bomb explodes in 10 seconds!!, get the hell out of there!", 3000, 3);
ExplodeBomb[playerid] = SetTimerEx("ExplodeBombTimer", 10000, false, "d", playerid);
return 1;
}
forward ExplodeBombTimer(playerid);
public ExplodeBombTimer(playerid)
{
CreateExplosion(259.2780,1855.8953,8.7578, 7, 5000.0);
DestroyObject(Bomb);
GameTextForAll("BOOOOOOMMM!!!", 1000, 3);
BombPlanted = 0;
SendClientMessage(playerid, COLOR_GREEN, "you earned {FF0000}$10000 {00FF00} and {FF0000}10 score {00FF00} for planting the bomb in army base");
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +10);
return 1;
}
pls fix
gamemode : http://www.solidfiles.com/d/df0b725c92/
the code i entered:-
public OnPlayerEnterDynamicCP(playerid, checkpointid)
if(checkpointid == PlantbombCP)
{
if(AllTeams[playerid] == ARMY && (BombPlanted == 1))
{
DefuseTimer = SetTimerEx("DefuseBomb", 10000, false, "is", playerid);
Defusing = 1;
GameTextForAll("~b~Army is trying to defuse the bomb!!~n~~r~Terrorists, Try to stop them!", 3000, 3);
return 1;
}
else return 0;
}
forward DefuseBomb(playerid);
public DefuseBomb(playerid)
{
if(Defusing == 1)
{
KillTimer(DefuseTimer);
KillTimer(BombExplodeTimer);
KillTimer(ExplodeBomb[playerid]);
GameTextForAll("Army successfully defused the bomb!", 3000, 3);
GivePlayerMoney(playerid, 10000);
Defusing = 0;
BombPlanted = 0;
DestroyObject(Bomb);
SetPlayerScore(playerid, GetPlayerScore(playerid) +10);
SendClientMessage(playerid, COLOR_GREEN, "you earned {FF0000}$10000 {00FF00}and {FF0000}10 score {00FF00}for defusing the bomb");
return 1;
}
return 1;
CMD: plantbomb(playerid, params[])
{
if(IsPlayerInDynamicCP(playerid, PlantbombCP) && (AllTeams[playerid] == TERRORISTS && (BombPlanted == 0)))
{
Bomb = CreateObject(3786,259.2780,1855.8953,8.7578,196.86 89,0,0, 100.0);
BombExplodeTimer = SetTimer("BombExplodes", 110000, 0);
GameTextForAll("~r~Terrorists planted a bomb in ~b~Army base~n~~g~army try to defuse it~n~ ~r~stand in checkpoint for 10 seconds to defuse it!", 4000, 3);
BombPlanted = 1;
}
else if(IsPlayerInDynamicCP(playerid, PlantbombCP) && (AllTeams[playerid] == TERRORISTS && (BombPlanted != 0))) return SendClientMessage(playerid, COLOR_RED, "The bomb is already planted!");
return 1;
}
forward BombExplodes(playerid);
public BombExplodes(playerid)
{
GameTextForAll("Bomb explodes in 10 seconds!!, get the hell out of there!", 3000, 3);
ExplodeBomb[playerid] = SetTimerEx("ExplodeBombTimer", 10000, false, "d", playerid);
return 1;
}
forward ExplodeBombTimer(playerid);
public ExplodeBombTimer(playerid)
{
CreateExplosion(259.2780,1855.8953,8.7578, 7, 5000.0);
DestroyObject(Bomb);
GameTextForAll("BOOOOOOMMM!!!", 1000, 3);
BombPlanted = 0;
SendClientMessage(playerid, COLOR_GREEN, "you earned {FF0000}$10000 {00FF00} and {FF0000}10 score {00FF00} for planting the bomb in army base");
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +10);
return 1;
}