Započeo mijata
•12. Jan. 2015.• Zaključano[Problem]BOMBA :(
785
pregleda
27
postova
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
108
Postovi:
26
Teme:
Pridružio se:Feb. 2014
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:
Neke slike/video za lakse dobivanje pomoci(neobavezno):///
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):///
OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
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
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++)OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
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...
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
108
Postovi:
26
Teme:
Pridružio se:Feb. 2014
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;
}OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
108
Postovi:
26
Teme:
Pridružio se:Feb. 2014
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 😄
i eto ti sta se desi kad se ja trudim zato ti svo vreme pricam da mi uradis 😄
OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
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...
Malo samo razmislis i eto ga dodjes do resenja...
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
108
Postovi:
26
Teme:
Pridružio se:Feb. 2014
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;OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
108
Postovi:
26
Teme:
Pridružio se:Feb. 2014
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
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;
}OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
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;
}
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava