Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <streamer>
- #include <sscanf2>
- #pragma tabsize 0
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define FILTERSCRIPT
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- new c4[MAX_PLAYERS];
- new pc4[11][MAX_PLAYERS];
- new Float:c4x[11][MAX_PLAYERS];
- new Float:c4y[11][MAX_PLAYERS];
- new Float:c4z[11][MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("ThunderX PlantC4 IS LOADED");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print("ThunderX PlantC4 IS NOT LOAD");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- for(new A;A < 11;A++)
- {
- c4x[A][playerid] = 9999;
- c4y[A][playerid] = 9999;
- c4z[A][playerid] = 9999;
- }
- c4[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- for(new A;A < 11;A++)
- {
- c4x[A][playerid] = 9999;
- c4y[A][playerid] = 9999;
- c4z[A][playerid] = 9999;
- DestroyDynamicObject(pc4[A][playerid]);
- }
- c4[playerid] = 0;
- return 1;
- }
- CMD:C4C(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_GREEN,"====================[CREDITS]====================");
- SendClientMessage(playerid,COLOR_RED,"Credits: ThunderX AND TX-TEAM");
- SendClientMessage(playerid,COLOR_GREEN,"=================================================");
- return 1;
- }
- CMD:plantc4(playerid,params[])
- {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"You cannot plant C4 in a vehicle!!");
- if(c4[playerid] == 5) return SendClientMessage(playerid,-1,"Error:- You can only plant 5 C4");
- new A;
- c4[playerid] ++;
- A = c4[playerid];
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- c4x[A][playerid] = x;
- c4y[A][playerid] = y;
- c4z[A][playerid] = z;
- GivePlayerWeapon(playerid, 40, 1);
- SendClientMessage(playerid,-1,"Press FIRE key to explode it or use /bomb.");
- pc4[A][playerid] = CreateDynamicObject(363,x,y,z-0.9,-90,0,0,-1,-1,-1,200); // <------- C4 VERTION 2.0
- return 1;
- }
- CMD:bomb(playerid,params[])
- {
- if(c4[playerid] != 0)
- {
- for(new A; A < 11;A++)
- {
- if(c4x[A][playerid] != 9999 && c4y[A][playerid] != 9999 && c4z[A][playerid] != 9999)
- {
- CreateExplosion(c4x[A][playerid],c4y[A][playerid],c4z[A][playerid],7,30.0);
- SendClientMessage(playerid,-1,"C4 explode!!!.");
- DestroyDynamicObject(pc4[A][playerid]);
- c4x[A][playerid] = 9999;
- c4y[A][playerid] = 9999;
- c4z[A][playerid] = 9999;
- }
- }
- c4[playerid] = 0;
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_FIRE))
- {
- if(GetPlayerWeapon(playerid) == 40)
- {
- if(c4[playerid] != 0)
- {
- for(new A; A < 11;A++)
- {
- if(c4x[A][playerid] != 9999 && c4y[A][playerid] != 9999 && c4z[A][playerid] != 9999)
- {
- CreateExplosion(c4x[A][playerid],c4y[A][playerid],c4z[A][playerid],7,30.0);
- SendClientMessage(playerid,-1,"C4 explode!!!.");
- DestroyDynamicObject(pc4[A][playerid]);
- c4x[A][playerid] = 9999;
- c4y[A][playerid] = 9999;
- c4z[A][playerid] = 9999;
- }
- }
- c4[playerid] = 0;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement