Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new mclass[MAX_PLAYERS], // set to one to activate class
- mtog[MAX_PLAYERS], // toggles like a bool
- mbul[MAX_PLAYERS] = 3, //bullets, I recommend three.
- Float:x, // var for explosion
- Float:y, // var for explosion
- Float:z, // var for explosion
- Float:x1, // useless var for GetPlayerLastShotVectors only
- Float:y1, // useless var for GetPlayerLastShotVectors only
- Float:z1; // useless var for GetPlayerLastShotVectors only
- #define TIMEMS 100 //How much M/S will it explode after you shot a weapon
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (PRESSED(KEY_YES))
- {
- if(mclass[playerid] == 1 && mtog[playerid] == 1 && GetPlayerWeapon(playerid) == 31)
- {
- if(mbul[playerid] == 0) return SendClientMessage(playerid, -1, "Joolt has no bullets left.");
- mtog[playerid] = 0;
- SendClientMessage(playerid, -1, "Joolt unloaded.");
- return 1;
- }
- if(mclass[playerid] == 1 && mtog[playerid] == 0 && GetPlayerWeapon(playerid) == 31)
- {
- if(mbul[playerid] == 0) return SendClientMessage(playerid, -1, "Joolt has no bullets left.");
- mtog[playerid] = 1;
- SendClientMessage(playerid, -1, "Joolt loaded.");
- return 1;
- }
- }
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(mclass[playerid] == 1 && mtog[playerid] == 1 && weaponid == 31)
- {
- if(mbul[playerid] == 0) return SendClientMessage(playerid, -1, "Joolt has no bullets left.");
- SetTimerEx("exp", TIMEMS, false, "i", playerid);
- mbul[playerid]--;
- return 1;
- }
- return 1;
- }
- forward exp(playerid);
- public exp(playerid)
- {
- GetPlayerLastShotVectors(playerid, x1, y1, z1, x, y, z);
- CreateExplosion(x, y, z, 12, 20.0);
- return 1;
- }
- //only for debug
- CMD:lel(playerid, params[])
- {
- mclass[playerid] = 1;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment