04.06.2013, 09:52
(
Последний раз редактировалось CreativityLacker; 05.06.2013 в 08:22.
)
C-Guns
Anything and everything for guns
[BETA]
Anything and everything for guns
[BETA]
pawn Код:
forward OnPlayerWeaponHack(playerid, weaponid, allowed_ammo, owned_ammo);
/*
native SetDangerHealth(Float:danger); // if the player's health is less than this, it'll do PlayerBulletCheck
native GetDangerHealth();
native GetPlayerBulletsShot(playerid); //Returns the amount of bullets shot
native GetPlayerBulletsHit(playerid); // Returns the amount of bullets HIT
native Float:GetBulletsHitAccuracy(playerid); //Returns accuracy in % PERCENTAGE
native GivePlayerWeaponEx(playerid, weaponid, ammo);
native ResetPlayerWeaponsEx(playerid);
native SetPlayerAmmoEx(playerid, weaponid, ammo);
native GetPlayerAllowedAmmo(playerid, weaponid); //returns the player's ALLOWED ammo
native GetPlayerActualAmmo(playerid, weaponid); //returns the ammo the player POSSESSES
//only use these func's if you know them
native GetWeaponSlot(weaponid);
native IsWeaponGun(weaponid); //Returns if the weapon ID is a gun
native WeaponHackCheck(playerid); // Checking for player weapon hacks
native GiveValidWeapons(playerid); // DO NOT USE
native PlayerBulletCheck(playerid); //DO NOT USE
*/
How does it work?
This include basically synchronizes each player's weapon data (no timer) with the server.
In addition to that, it counts the BULLETS SHOT and BULLETS HIT of each player for you.
It includes -
Bullets shot/hit + accuracy
Player's weapon and ammo synchronization
Weapon hack check
Note that this include is currently in BETA, I have tested all the existing features but there may or may not be unknown bugs. If there are any such bugs, you can immediately report here/PM me regarding such bugs.
Installation
In order to install -
Include C-guns and that's it (Thanks to Lordz™ for hooking )
Note that the WeaponHackCheck stock can be used anywhere, but preferably do not use it anywhere as it has been inbuilt in the script already!
Thanks to -
CreativityLacker - the idea/implementation/scripting
MarcObeles20 - testing the include and giving me more idea's
Lordz™ - for hooking OnPlayerTakeDamage and OnPlayerConnect and also all the stocks
To whoever who made the GetWeaponSlot function
Download -
BETA -
LATEST PASTEBIN- http://pastebin.com/fg462S2i
Mediafire [V0.25] - http://www.mediafire.com/download/p2...5BV0.25%5D.inc
Mediafire [BETA]- http://www.mediafire.com/download/tx...e%5DC-guns.inc
NOTE- pastebin will always be updated, but mediafire link MAY or MAY NOT be outdated.