Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // --------------------- > [ Bomba System ] < ---------------------------
- // --------------------- > [ Credits: Belic ] < ------------------------
- #define FILTERSCRIPT
- #include <a_samp>
- new bomba1[MAX_PLAYERS];
- #define DIALOG_BOMBAHELP 1
- #define BOMBA_SLOT 1
- new bomba;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Bomba System");
- print("--------------------------------------\n");
- CreatePickup(1252, 1, 1566.4193, 23.3089, 24.1641, -1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- bomba1[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/bombhelp", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_BOMBAHELP, DIALOG_STYLE_MSGBOX, "Bomba Help", "/bomblocation\n/buybomb\n/setbomb\n/activatebomb", "Ok", "Ok");
- return 1;
- }
- if (strcmp("/buybomb", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid,1.0, 1566.4193, 23.3089, 24.1641))
- {
- if(bomba1[playerid] == 0)
- {
- SetPlayerAttachedObject(playerid, BOMBA_SLOT, 1252, 6, 0.3, 0.1, 0,0,-90,0, 1.0, 1.0, 1.0, 0, 0);
- SendClientMessage(playerid, -1, "Kupili ste bombu");
- bomba1[playerid] = 1;
- }
- }
- return 1;
- }
- if (strcmp("/bomblocation", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid,1553.5643,47.5134,24.7817);
- return 1;
- }
- if (strcmp("/setbomb", cmdtext, true, 10) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(bomba1[playerid] == 1)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, BOMBA_SLOT)) RemovePlayerAttachedObject(playerid, BOMBA_SLOT);
- bomba = CreateObject(1252, x, y, z, 0.0, 0.0, 96.0);
- SendClientMessage(playerid, -1, "Postavili ste bombu! Da je aktivirate /activatebomb!");
- bomba1[playerid] = 0;
- return 1;
- }
- }
- if (strcmp("/activatebomb", cmdtext, true, 10) == 0)
- {
- new Float:b1, Float:b2, Float:b3;
- GetObjectPos(bomba, b1, b2, b3);
- CreateExplosion(b1, b2, b3, 1, 9.0);
- CreateExplosion(b1, b2, b3, 1, 9.0);
- CreateExplosion(b1, b2, b3, 1, 9.0);
- CreateExplosion(b1, b2, b3, 1, 9.0);
- CreateExplosion(b1, b2, b3, 1, 9.0);
- DestroyObject(bomba);
- return 1;
- }
- return 0;
- }
- ///////////////////// ---- > Izradio Belic < ---- ///////////////////////////////////////////
Add Comment
Please, Sign In to add comment