plant bonbs??
#1

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;
}
Reply
#2

You are not actually telling us what/which 'many errors' you've encountering, try this from a quick review of the code:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
     if(checkpointid == PlantbombCP)
     {
          if(AllTeams[playerid] == ARMY && (BombPlanted == 1))
          {
               DefuseTimer = SetTimerEx("DefuseBomb", 10_000, false, "i", 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;
}

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;
}
Reply
#3

am getting many errors u try putting code in the gamemode and compile it
and fix if possible
Reply
#4

Could you post the errors you get when you compile here [ pawn ]here![ /pawn ] without the spaces.
Reply
#5

i am getting many errors pls check with gamemode
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)