10.02.2009, 22:04
Weapon Synchronizer include v0.0 by vovo4ka
file VWSi.inc
I write the new role play gamemode and I had a problem with my ammo system.
It's needs to save ammo correctly. Ammo anti-cheating system needs too. But GetPlayerWeaponData, GetPlayerAmmo is bugged, it sometimes returns an incorrect ammo amount.
I researched(5 days left ) this bug and have written include, helping as much as possible precisely to define correct ammo info.
It works very precisely. Maximum difference in one weapon slot - 5 bullets which I saw and it's perfectly for saving ammo info and weapon anti-cheat.
For usage it's necessary to replace standard functions on these:
And add some function call's in OnGameModeInit, OnPlayerUpdate, OnGameModeExit, OnPlayerSpawn.
all examples in example.pwn
But, all operations with weapons and ammo should be passed through them. (actually the incorrect data will be until then while the player will not shoot. (It concerns only "old-type" pickups and аммо purchases))
I have included in an example how correctly to work with pickups.
If will find serious lags inform me please
Download this:
(bad english. sorry )
file VWSi.inc
I write the new role play gamemode and I had a problem with my ammo system.
It's needs to save ammo correctly. Ammo anti-cheating system needs too. But GetPlayerWeaponData, GetPlayerAmmo is bugged, it sometimes returns an incorrect ammo amount.
I researched(5 days left ) this bug and have written include, helping as much as possible precisely to define correct ammo info.
It works very precisely. Maximum difference in one weapon slot - 5 bullets which I saw and it's perfectly for saving ammo info and weapon anti-cheat.
For usage it's necessary to replace standard functions on these:
- ResetPlayerWeaponsEx(playerid)
- GetPlayerWeaponEx(playerid)
- GetPlayerAmmoEx(playerid)
- GetPlayerWeaponDataEx(playerid, slot, &weapons, &ammo)
- GivePlayerWeaponEx(playerid, weaponid, ammount)
And add some function call's in OnGameModeInit, OnPlayerUpdate, OnGameModeExit, OnPlayerSpawn.
all examples in example.pwn
But, all operations with weapons and ammo should be passed through them. (actually the incorrect data will be until then while the player will not shoot. (It concerns only "old-type" pickups and аммо purchases))
I have included in an example how correctly to work with pickups.
If will find serious lags inform me please
Download this:
(bad english. sorry )