Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- CREDITS
- All credits to Scripter123.
- You don't have premission to EDIT or REMOVE credits
- You don't have premission to put it IN BLOGS or your own WEBSITE, if you want sendme a PM in SAMP-FORUMS
- my user name is SCRIPTER123 or add my EMAIL: nunozastas@hotmail.com
- You don't have premission to EDIT my FS and UPLOAD it again, if i know this you will got a report.
- Enjoy :)
- INFO
- So you got some warnings when compile, but don't worry, because its only NOOB warnings :) :D.
- In this FS (FILTERSCRIPT) you have some commands like: /C4help, /plantc4, /plantautoc4.
- I have the idea of making a auto explode in this C4 and i added a timer :)
- More one time, don't remove credits, and enjoy this FS.
- */
- #include <a_samp>
- new bombs [MAX_PLAYERS];
- new bomb1;
- new Float:X,Float:Y,Float:Z;
- forward bombplant(playerid);
- forward bombexplode(playerid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" C4 BOMB by: Scripter123");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- bombs[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/C4help", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, 0xFFFF00AA, "----------------------------- C4 HELP -----------------------------");
- SendClientMessage(playerid, 0xFFFFFFFF, "To plant a C4 bomb use /plantc4.");
- SendClientMessage(playerid, 0xFFFFFFFF, "If you wanna create a AUTO EXPLODE C4 BOMB use /plantautoc4");
- SendClientMessage(playerid, 0xFFFFFFFF, "To explode the C4 bomb use /explode or press FIRE (RMB or CTRL)");
- SendClientMessage(playerid, 0xFFFFFFFF, "REMEMBER: You need 1000$ to plant a C4 BOMB.");
- SendClientMessage(playerid, 0xFFFF00AA, "--------------------------------------------------------------------");
- }
- if (strcmp("/plantautoc4", cmdtext, true, 10) == 0)
- {
- GetPlayerPos(playerid,X,Y,Z);
- bomb1 = CreatePickup(1252,23,X,Y,Z,-1,-1);
- bombs[playerid]++;
- SendClientMessage(playerid,0xFFFFFFFF,"You planted the C4 BOMB. Run out of there!");
- SendClientMessage(playerid, 0xFFFFFFFF, "You selected auto detonate C4 BOMB. It will explode in 7 SECOUNDS!");
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
- SetTimer("bombplant",1500,false);
- SetTimer("bombexplode",7000,false);
- }
- if (strcmp("/plantc4", cmdtext, true, 10) == 0)
- {
- GetPlayerPos(playerid,X,Y,Z);
- bomb1 = CreatePickup(1252,23,X,Y,Z,-1,-1);
- bombs[playerid]++;
- SendClientMessage(playerid,0xFFFFFFFF,"You planted the C4 BOMB. Run out of there!");
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
- SetTimer("bombplant",1500,false);
- }
- if (strcmp("/explode", cmdtext, true, 10) == 0)
- {
- CreateExplosion(X,Y,Z,7,30.0);
- DestroyPickup(bomb1);
- SendClientMessage(playerid,0xFF00CCFF,"The bomb has been exploded.");
- bombs[playerid]--;
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_FIRE)
- {
- if(bombs[playerid] >= 1)
- {
- CreateExplosion(X,Y,Z,7,30.0);
- DestroyPickup(bomb1);
- SendClientMessage(playerid,0xFF00CCFF,"The bomb has been exploded.");
- bombs[playerid]--;
- }
- }
- return 1;
- }
- public bombplant(playerid)
- {
- ClearAnimations(playerid);
- return 1;
- }
- public bombexplode(playerid)
- {
- CreateExplosion(X,Y,Z,7,30.0);
- DestroyPickup(bomb1);
- SendClientMessage(playerid,0xFF00CCFF,"The bomb has been exploded.");
- bombs[playerid]--;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement