PDA

View Full Version : [Help]Bomb


Mijata
12/01/2015, 12:15 PM
why all players get +5 score when bomb explode i want only for the one who set

+rep ;)

#include <a_samp>
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA
#define SCM




new PostaviTim[MAX_PLAYERS];
new PlantedBomb = 0;
new Explode;


public OnGameModeInit()
{
return 1;
}


public OnGameModeExit()
{
return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
return 1;
}


public OnPlayerConnect(playerid)
{
PostaviTim[playerid] = 0;
return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
PostaviTim[playerid] = 0;
return 1;
}


public OnPlayerSpawn(playerid)
{
if (PostaviTim[playerid] == 0)
{
new Tim = random(2);
switch(Tim)
{
case 0:
{
PostaviTim[playerid] = 1;
//SetPlayerSkin(playerid, ID Skina); // Ovo stavi ako hoces
}
case 1:
{


PostaviTim[playerid] = 2;
//SetPlayerSkin(playerid, ID Skina); // Ovo stavi ako hoces
}
}
}
return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}


public OnVehicleSpawn(vehicleid)
{
return 1;
}


public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}


public OnPlayerText(playerid, text[])
{
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/plantbomb", cmdtext, true, 10) == 0)
{
if (PostaviTim[playerid] == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
if (PlantedBomb == 1) return SendClientMessage(playerid,COLOR_RED,"The bomb is already planted!");
PlantedBomb = 1;
GameTextForAll("~r~Bomb has been planted!",3000,5);
Explode = SetTimer("Explosion",300000,0);
}


if (strcmp("/defusebomb", cmdtext, true, 10) == 0)
{
if (PlantedBomb == 0) return SendClientMessage(playerid,COLOR_RED,"The bomb is not planted!");
if (PostaviTim[playerid] == 2)
{
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
SendClientMessage(playerid,COLOR_RED,"You are defusing a bomg, please wait.");
SetTimer("Defusion",20000,0);
}
else
{
SendClientMessage (playerid, COLOR_RED, "Only cops can defuse bomb");
}
}
return 0;
}
forward Explosion();
public Explosion()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerMoney(i, 10000);
SetPlayerScore(i, GetPlayerScore(i) + 5);
SendClientMessage(i, COLOR_RED, "Bomb:you got +5 score and 10000$ for planting bomb");
}
GameTextForAll("~r~Bomb exploded",6000,5);
CreateExplosion(212.9239,1820.3402,6.4216,12,20.0) ;
PlantedBomb = 0;
return 1;
}
forward Defusion();
public Defusion()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerMoney(i, 10000);
SetPlayerScore(i, GetPlayerScore(i) + 5);
SendClientMessage(i, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
}
KillTimer(Explode);
GameTextForAll("~r~Bomb defused",6000,5);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}


public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}


public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}


public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}


public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}


public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}


public OnRconCommand(cmd[])
{
return 1;
}


public OnPlayerRequestSpawn(playerid)
{
return 1;
}


public OnObjectMoved(objectid)
{
return 1;
}


public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}


public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}


public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}


public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}


public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}


public OnPlayerExitedMenu(playerid)
{
return 1;
}


public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}


public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}


public OnPlayerUpdate(playerid)
{
return 1;
}


public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}


public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}


public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}


public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}


public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Airman123
12/01/2015, 12:17 PM
You have used the variable "i" and you defined it for MAX_PLAYERS, that is why all the players playing takes the 5 scores.

Mijata
12/01/2015, 12:21 PM
how to fix it?

Ironboy
12/01/2015, 12:25 PM
how to fix it?

Use this

#include <a_samp>
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA
#define SCM




new PostaviTim[MAX_PLAYERS];
new PlantedBomb = 0;
new Explode;
new SetpScore[MAX_PLAYERS];

public OnGameModeInit()
{
return 1;
}


public OnGameModeExit()
{
return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
return 1;
}


public OnPlayerConnect(playerid)
{
PostaviTim[playerid] = 0;
SetpScore[playerid] = 0;
return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
PostaviTim[playerid] = 0;
SetpScore[playerid] = 0;
return 1;
}


public OnPlayerSpawn(playerid)
{
if (PostaviTim[playerid] == 0)
{
new Tim = random(2);
switch(Tim)
{
case 0:
{
PostaviTim[playerid] = 1;
//SetPlayerSkin(playerid, ID Skina); // Ovo stavi ako hoces
}
case 1:
{


PostaviTim[playerid] = 2;
//SetPlayerSkin(playerid, ID Skina); // Ovo stavi ako hoces
}
}
}
return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}


public OnVehicleSpawn(vehicleid)
{
return 1;
}


public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}


public OnPlayerText(playerid, text[])
{
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/plantbomb", cmdtext, true, 10) == 0)
{
if (PostaviTim[playerid] == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
if (PlantedBomb == 1) return SendClientMessage(playerid,COLOR_RED,"The bomb is already planted!");
PlantedBomb = 1;
SetpScore[playerid] = 1;
GameTextForAll("~r~Bomb has been planted!",3000,5);
Explode = SetTimer("Explosion",300000,0);
}


if (strcmp("/defusebomb", cmdtext, true, 10) == 0)
{
if (PlantedBomb == 0) return SendClientMessage(playerid,COLOR_RED,"The bomb is not planted!");
if (PostaviTim[playerid] == 2)
{
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
SendClientMessage(playerid,COLOR_RED,"You are defusing a bomg, please wait.");
SetTimer("Defusion",20000,0);
}
else
{
SendClientMessage (playerid, COLOR_RED, "Only cops can defuse bomb");
}
}
return 0;
}
forward Explosion();
public Explosion()
{
new playerid;
if(SetpScore[playerid] == 1)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SetpScore[playerid] = 0;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerMoney(i, 10000);
SendClientMessage(i, COLOR_RED, "Bomb:you got +5 score and 10000$ for planting bomb");
}
GameTextForAll("~r~Bomb exploded",6000,5);
CreateExplosion(212.9239,1820.3402,6.4216,12,20.0) ;
PlantedBomb = 0;
return 1;
}
forward Defusion();
public Defusion()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerMoney(i, 10000);
SetPlayerScore(i, GetPlayerScore(i) + 5);
SendClientMessage(i, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
}
KillTimer(Explode);
GameTextForAll("~r~Bomb defused",6000,5);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}


public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}


public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}


public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}


public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}


public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}


public OnRconCommand(cmd[])
{
return 1;
}


public OnPlayerRequestSpawn(playerid)
{
return 1;
}


public OnObjectMoved(objectid)
{
return 1;
}


public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}


public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}


public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}


public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}


public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}


public OnPlayerExitedMenu(playerid)
{
return 1;
}


public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}


public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}


public OnPlayerUpdate(playerid)
{
return 1;
}


public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}


public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}


public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}


public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}


public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

EDIT: This must be the Explosion callback and you have to do the same on diffusion callback to get it working perfectly.

forward Explosion();
public Explosion()
{
new playerid;
if(SetpScore[playerid] == 1)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SetpScore[playerid] = 0;
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(i) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for planting bomb");
}
GameTextForAll("~r~Bomb exploded",6000,5);
CreateExplosion(212.9239,1820.3402,6.4216,12,20.0) ;
PlantedBomb = 0;
return 1;
}

Airman123
12/01/2015, 12:26 PM
forward Defusion(playerid);
public Defusion(playerid)
{
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
KillTimer(Explode);
GameTextForAll("~r~Bomb defused",6000,5);
return 1;
}

Try this ^^

ATGOggy
12/01/2015, 12:26 PM
Change this:Explode = SetTimer("Explosion",300000,0);

to this: Explode = SetTimerEx("Explosion",300000,0, "i", playerid);

And

this:
forward Explosion();
public Explosion()
{
new playerid;
if(SetpScore[playerid] == 1)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SetpScore[playerid] = 0;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerMoney(i, 10000);
SendClientMessage(i, COLOR_RED, "Bomb:you got +5 score and 10000$ for planting bomb");
}
GameTextForAll("~r~Bomb exploded",6000,5);
CreateExplosion(212.9239,1820.3402,6.4216,12,20.0) ;
PlantedBomb = 0;
return 1;
}

to this:

forward Explosion(playerid);
public Explosion(playerid)
{
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for planting bomb");
GameTextForAll("~r~Bomb exploded",6000,5);
CreateExplosion(212.9239,1820.3402,6.4216,12,20.0) ;
PlantedBomb = 0;
return 1;
}

Airman123
12/01/2015, 12:28 PM
Yes ATGOGGY, You are right. btw GetPlayerScore(i) "GetPlayerScore(playerid)"

ATGOggy
12/01/2015, 12:29 PM
Yes ATGOGGY, You are right. btw GetPlayerScore(i) "GetPlayerScore(playerid)"

Oh, sorry. You are right. Edited.

Mijata
12/01/2015, 12:32 PM
i will try now

Mijata
12/01/2015, 12:42 PM
work thanks + rep for all

Mijata
12/01/2015, 02:35 PM
now all players get +5 score when bomb is defused i want only for the one who defuse

Mijata
12/01/2015, 02:45 PM
bump

Ironboy
12/01/2015, 02:49 PM
This must be it

new dbomb[MAX_PLAYERS];

if (strcmp("/defusebomb", cmdtext, true, 10) == 0)
{
if (PlantedBomb == 0) return SendClientMessage(playerid,COLOR_RED,"The bomb is not planted!");
if (PostaviTim[playerid] == 2)
{
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
SendClientMessage(playerid,COLOR_RED,"You are defusing a bomg, please wait.");
dbomb[playerid] = 1;
SetTimer("Defusion",20000,0);
}
else
{
SendClientMessage (playerid, COLOR_RED, "Only cops can defuse bomb");
}
}

forward Defusion();
public Defusion()
{
new playerid;
if(dbomb[playerid] == 1)
{
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
dbomb[playerid] = 0;
}
KillTimer(Explode);
GameTextForAll("~r~Bomb defused",6000,5);
return 1;
}


Don't forget to reset the var.

Mijata
12/01/2015, 03:08 PM
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(108) : warning 217: loose indentation
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(124) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(124) : error 017: undefined symbol "Defusion"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(125) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(125) : error 017: undefined symbol "Defusion"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(127) : warning 219: local variable "playerid" shadows a variable at a preceding level
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(140) : warning 225: unreachable code
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(140) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(140) : error 017: undefined symbol "Explosion"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(141) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(141) : error 017: undefined symbol "Explosion"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(151) : warning 225: unreachable code
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(151) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(151) : error 017: undefined symbol "Defusion"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(152) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\BOMBA.pwn(152) : error 017: undefined symbol "Defusion"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.

Ironboy
12/01/2015, 03:25 PM
I guess you've missed a bracket somewhere other than the script i've given above.

Mijata
12/01/2015, 03:48 PM
create all at script without errors and bugs +rep ;)

Ironboy
12/01/2015, 04:00 PM
You gotta learn something

#include <a_samp>
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA
#define SCM

new PostaviTim[MAX_PLAYERS];
new PlantedBomb = 0;
new Explode;
new SetpScore[MAX_PLAYERS];
new dbomb[MAX_PLAYERS];

public OnGameModeInit()
{
return 1;
}


public OnGameModeExit()
{
return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
return 1;
}


public OnPlayerConnect(playerid)
{
PostaviTim[playerid] = 0;
SetpScore[playerid] = 0;
dbomb[playerid] = 0;
return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
PostaviTim[playerid] = 0;
SetpScore[playerid] = 0;
dbomb[playerid] = 0;
return 1;
}


public OnPlayerSpawn(playerid)
{
if (PostaviTim[playerid] == 0)
{
new Tim = random(2);
switch(Tim)
{
case 0:
{
PostaviTim[playerid] = 1;
//SetPlayerSkin(playerid, ID Skina); // Ovo stavi ako hoces
}
case 1:
{


PostaviTim[playerid] = 2;
//SetPlayerSkin(playerid, ID Skina); // Ovo stavi ako hoces
}
}
}
return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}


public OnVehicleSpawn(vehicleid)
{
return 1;
}


public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}


public OnPlayerText(playerid, text[])
{
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/plantbomb", cmdtext, true, 10) == 0)
{
if (PostaviTim[playerid] == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
if (PlantedBomb == 1) return SendClientMessage(playerid,COLOR_RED,"The bomb is already planted!");
PlantedBomb = 1;
SetpScore[playerid] = 1;
GameTextForAll("~r~Bomb has been planted!",3000,5);
Explode = SetTimer("Explosion",300000,0);
}


if (strcmp("/defusebomb", cmdtext, true, 10) == 0)
{
if (PlantedBomb == 0) return SendClientMessage(playerid,COLOR_RED,"The bomb is not planted!");
if (PostaviTim[playerid] == 2)
{
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,182 0.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
SendClientMessage(playerid,COLOR_RED,"You are defusing a bomg, please wait.");
dbomb[playerid] = 1;
SetTimer("Defusion",20000,0);
}
else
{
SendClientMessage (playerid, COLOR_RED, "Only cops can defuse bomb");
}
}
return 0;
}
forward Explosion();
public Explosion()
{
new playerid;
if(SetpScore[playerid] == 1)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SetpScore[playerid] = 0;
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for planting bomb");
}
GameTextForAll("~r~Bomb exploded",6000,5);
CreateExplosion(212.9239,1820.3402,6.4216,12,20.0) ;
PlantedBomb = 0;
return 1;
}

forward Defusion();
public Defusion()
{
new playerid;
if(dbomb[playerid] == 1)
{
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
dbomb[playerid] = 0;
}
KillTimer(Explode);
GameTextForAll("~r~Bomb defused",6000,5);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}


public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}


public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}


public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}


public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}


public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}


public OnRconCommand(cmd[])
{
return 1;
}


public OnPlayerRequestSpawn(playerid)
{
return 1;
}


public OnObjectMoved(objectid)
{
return 1;
}


public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}


public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}


public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}


public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}


public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}


public OnPlayerExitedMenu(playerid)
{
return 1;
}


public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}


public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}


public OnPlayerUpdate(playerid)
{
return 1;
}


public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}


public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}


public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}


public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}


public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Mijata
12/01/2015, 04:26 PM
why is now bomb planted when is defused ??

Mijata
12/01/2015, 05:05 PM
bump

Mijata
12/01/2015, 05:37 PM
bump

Mijata
12/01/2015, 06:54 PM
why is now bomb planted when is defused ??

Bondage
12/01/2015, 07:03 PM
why is now bomb planted when is defused ??

You mean the bomb is not exploding?

Mijata
12/01/2015, 07:18 PM
no , when is bomb defused he is again planted player can agian and again defuse

Ironboy
12/01/2015, 07:27 PM
no , when is bomb defused he is again planted player can agian and again defuse

Use this instead

forward Defusion();
public Defusion()
{
new playerid;
if(dbomb[playerid] == 1)
{
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
dbomb[playerid] = 0;
}
KillTimer(Explode);
GameTextForAll("~r~Bomb defused",6000,5);
PlantedBomb = 0;
return 1;
}

Mijata
12/01/2015, 07:46 PM
now work thanks

Mijata
12/01/2015, 08:48 PM
ah now is problem bomb can't be defused when player type /defusebomb he have mesage defusing.... but bomb explode

Ironboy
12/01/2015, 08:53 PM
It depends on the timer that you set.

Mijata
12/01/2015, 08:59 PM
can u help me with it send me

Mijata
12/01/2015, 09:12 PM
pls help send me it bomb can't be defused

Ironboy
12/01/2015, 10:50 PM
Why would you want to take this long time to defuse the bomb? within the given defuse time the explosion would happen. So lower the "Defusion" timer.

Mijata
13/01/2015, 12:21 AM
ok i fixed can u help me here : http://forum.sa-mp.com/showthread.php?t=557167