[Problem]BOMBA :(

Započeo mijata
12. Jan. 2015. Zaključano
759
pregleda
27
postova
mijata
4
Shot Caller
12. Jan. 2015.
Skripta koju koristim😄M
Detaljan opis problema:problem je u tome kada bomba eksplodira svi dobiju po 5 score umesto samo onaj koji je postavio bombu isto tako  i sa defuse
Dio skripte:
#include 
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA
#define SCM

new PostaviTim;
new PlantedBomb = 0;
new Explode;

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

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

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

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

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

        PostaviTim = 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 == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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 == 2)
{
if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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;
}


Neke slike/video za lakse dobivanje pomoci(neobavezno):///
Rudimental
5
OG Legend
12. Jan. 2015.
Promeni ovo za tajmere iz SetTimer stavi u SetTimerEx
Pogledaj i ovo jer su razliciti http://wiki.sa-mp.com/wiki/SetTimerEx

I kod publica za te bombe dodaj za public parametar playerid a ovaj kod skloni iz publica
for(new i = 0; i < MAX_PLAYERS; i++)
mijata
4
Shot Caller
12. Jan. 2015.
aj mi posalji u kodu to da ne sje**m nesto
Rudimental
5
OG Legend
12. Jan. 2015.
Nema sta da zeznes ako uradis kao sto sam ti rekao ...
mijata
4
Shot Caller
12. Jan. 2015.
aj ipak ti meni to posalji 😄
Rudimental
5
OG Legend
12. Jan. 2015.
Kao sto sam vec dosta puta rekao ovaj PDF nije uradi mi po zelji vec pomoc ja sam ti rekao sta trebas da uradis a ti sada ispadni fer prema meni pa bar pokusaj nesto da sredis pomocu ovoga sto sam ti poslao a ako negde zakoci s errorima ili nesto tu sam da ti pomognem. Ali ajde se bar malo potrudi a ne da ti neko sve uradi...
mijata
4
Shot Caller
12. Jan. 2015.
e to sam nekako uradio i radi , moze se nauciti ovo samo malo treba vremena , sad mi je problem to sto posle defuse opet pise da je bomba plantirana umesto da bomba nije plantirana posle defuse
#include 
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA
#define SCM

new PostaviTim;
new PlantedBomb = 0;
new Explode;
new SetpScore;
new dbomb;

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

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

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

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

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

                PostaviTim = 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 == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
        if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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 = 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 == 2)
        {
            if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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 = 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 == 1)
    {
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SetpScore = 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 == 1)
    {
        GivePlayerMoney(playerid, 10000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
        dbomb = 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;
}
Rudimental
5
OG Legend
12. Jan. 2015.
Ne razumem sta gde kako 😄 usput tajmere nisi sredio kao sto sam ti vec rekao...
mijata
4
Shot Caller
12. Jan. 2015.
pa kada neko planta bombu i kada je policija defuse onda igrac nemoze opet da planta bombu zato sto pise da je vec postavljena a policija moze da je defuse stalno

i eto ti sta se desi kad se ja trudim zato ti svo vreme pricam da mi uradis 😄
Rudimental
5
OG Legend
12. Jan. 2015.
Pa napravio si varijablu PlantedBomb koja ti da kazemo oznacuje dali je bomba postavljena ili ne. Ti si stavio u koliko je vrednost na 1 da je to postavljena a ako je 0 onda nije e sada razmisli kada je /defuse pojavi se tajmer ali kada tajmer odradi ti nisi stavio PlantedBomb na 0 zar ne ? 😄
Malo samo razmislis i eto ga dodjes do resenja...
mijata
4
Shot Caller
12. Jan. 2015.
mislis ovako ? 😄
forward Explosion();
public Explosion()
{
    new playerid;
    if(SetpScore == 1)
    {
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SetpScore = 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 == 1)
    {
        GivePlayerMoney(playerid, 10000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
        dbomb = 0;
    }
    KillTimer(Explode);
    GameTextForAll("~r~Bomb defused",6000,5);
    PlantedBomb = 0;
Rudimental
5
OG Legend
12. Jan. 2015.
Da jel radi
mijata
4
Shot Caller
12. Jan. 2015.
radi samo sad bomba nemoze da bude deaktivirana kada ja plantam bombu i drugi igrac je /defusebomb njemu pise bomba se deaktivira sacekaj onda bomba ne bude deaktivirana nego eksplodira
a timer za defuse je samo 20 sekundi a mi smo to uradili cim sam ja plantao
#include 
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA
#define SCM

new PostaviTim;
new PlantedBomb = 0;
new Explode;
new SetpScore;
new dbomb;

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

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

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

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

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

                PostaviTim = 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 == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
        if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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 = 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 == 2)
        {
            if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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 = 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 == 1)
    {
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SetpScore = 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 == 1)
    {
        GivePlayerMoney(playerid, 10000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
        dbomb = 0;
    }
    KillTimer(Explode);
    GameTextForAll("~r~Bomb defused",6000,5);
    PlantedBomb = 0;
    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;
}
Rudimental
5
OG Legend
12. Jan. 2015.

#include
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000BBAA

new PostaviTim;
new PlantedBomb = 0;
new Explode;
new SetpScore;
new dbomb;

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

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

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

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/plantbomb", cmdtext, true, 10) == 0)
    {
        if (PostaviTim == 2) return SendClientMessage (playerid, COLOR_RED, "Cops can't plant bomb");
        if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.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,"Bomba je vec postavljena!");
        PlantedBomb = 1;
        SetpScore = 1;
        GameTextForAll("~r~Bomb has been planted!",3000,5);
        Explode = SetTimerEx("Explosion", 300000, false, "i", playerid);
    }

    if (strcmp("/defusebomb", cmdtext, true, 10) == 0)
    {
        if (PostaviTim == 2)
        {
            if (!IsPlayerInRangeOfPoint(playerid,2.0,212.9239,1820.3402,6.4216)) return SendClientMessage(playerid,COLOR_RED,"You are not in the place for planting the bomb");
            if (PlantedBomb == 0) return SendClientMessage(playerid,COLOR_RED,"Niko nije postavio bombu!");
            SendClientMessage(playerid,COLOR_RED,"You are defusing a bomg, please wait.");
            dbomb = 1;
            SetTimerEx("Defusion", 20000, false, "i", playerid);
        }
        else
        {
            SendClientMessage (playerid, COLOR_RED, "Only cops can defuse bomb");
        }
    }
    return 0;
}

forward Explosion(playerid);
public Explosion(playerid)
{
    if(SetpScore == 1)
    {
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SetpScore = 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(playerid);
public Defusion(playerid)
{
    if(dbomb == 1)
    {
        GivePlayerMoney(playerid, 10000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
        SendClientMessage(playerid, COLOR_RED, "Bomb:you got +5 score and 10000$ for defusing bomb");
        dbomb = 0;
    }
    KillTimer(Explode);
    GameTextForAll("~r~Bomb defused",6000,5);
    PlantedBomb = 0;
    return 1;
}

mijata
4
Shot Caller
12. Jan. 2015.
sad bomba eksplodira 2 puta za redom

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha