Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define distBullet 30
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" €xPLØsiv€ BÜLL€TTS B¥ GhØsT[×] Loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" €xPLØsiv€ BÜLL€TTS B¥ GhØsT[×] Unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPVarInt(playerid,"shootingExplosive",0);
- SetPVarInt(playerid,"exploBullet",0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SetPVarInt(playerid,"shootingExplosive",0);
- SetPVarInt(playerid,"exploBullet",0);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPVarInt(playerid,"shootingExplosive",0);
- SetPVarInt(playerid,"exploBullet",0);
- GivePlayerWeapon(playerid,30,999);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SetPVarInt(playerid,"shootingExplosive",0);
- 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("/explobullet", cmdtext, true, 10) == 0)
- {
- if( GetPVarInt(playerid,"exploBullet") == 1)
- {
- SetPVarInt(playerid,"exploBullet",0);
- SendClientMessage(playerid, 0x400080FF, "Munição Explosiva Desativada!");
- }
- else if( GetPVarInt(playerid,"exploBullet") == 0)
- {
- SetPVarInt(playerid,"exploBullet",1);
- SendClientMessage(playerid, 0x400080FF, "Munição Explosiva Ativada!");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerUpdate(playerid)
- {
- if( GetPVarInt(playerid,"shootingExplosive") == 1)
- {
- new Float:blahx, Float:blahy, Float:blahz, Float:angle;
- GetPosFromView(playerid, distBullet, blahx, blahy, blahz);
- GetPlayerFacingAngle(playerid, angle);
- CreateExplosion(blahx, blahy, blahz, 0, 1.0);
- SetPVarInt(playerid,"shootingExplosive",0);
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
- {
- if(GetPVarInt(playerid,"exploBullet") == 1)
- {
- if(GetPlayerWeapon(playerid) == 29 || GetPlayerWeapon(playerid) == 30 || GetPlayerWeapon(playerid) == 31)
- {
- if(GetPlayerWeaponState(playerid) != 3 && GetPlayerWeaponState(playerid) == 2)
- {
- //printf("%d",GetPlayerWeaponState(playerid)); Debugging Purposes
- CallLocalFunction("OnPlayerUpdate","d",playerid);
- SetPVarInt(playerid,"shootingExplosive",1);
- }
- }
- }
- }
- return 1;
- }
- stock GetPosFromView(playerid, Float:distance, &Float:x, &Float:y, &Float:z)
- {
- new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
- GetPlayerCameraPos(playerid, cx, cy, cz);
- GetPlayerCameraFrontVector(playerid, fx, fy, fz);
- x = fx * distance + cx;
- y = fy * distance + cy;
- z = fz * distance + cz;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement