Posts: 664
Threads: 65
Joined: Jul 2011
Reputation:
0
i have no script and i dont want it made for me but i want to be pointed in the right direction
i want to know how to make a script that when u run out of ammo it sends a message to the player saying you Are Out Of Ammo then the player type's /reload and it restores the player's ammo of the gun he is holding at the moment. if u can show me an example or point me in the right direction
regards.
[Nuclear]Phoebe.
Posts: 96
Threads: 25
Joined: Aug 2009
Reputation:
0
I would try to create a very frequent timer (or maybe OnPlayerUpdate) and a boolean like bool:ToldOutOfAmmo[MAX_PLAYERS];
Every time the timer passing you check wether or not the player has a weapon (just check his weapon-id) and then GetPlayerAmmo. If it's 0 check if ToldOutOfAmmo is true, else send a message to him and set it to true.
For the /reload just use SetPlayerAmmo then.
Hope it helped.
Posts: 664
Threads: 65
Joined: Jul 2011
Reputation:
0
ok i get /reload but i dont get the rest
Posts: 664
Threads: 65
Joined: Jul 2011
Reputation:
0
ive made my reload cmd but i cant grasp the out of bullets thing
Posts: 664
Threads: 65
Joined: Jul 2011
Reputation:
0
but wouldn't it when u have no ammo remove the gun from ur hand?
Posts: 564
Threads: 149
Joined: Jan 2011
Reputation:
0
ResetPlayerWeapons(playerid);
Posts: 664
Threads: 65
Joined: Jul 2011
Reputation:
0
no dude i dont want it to remove the weapon
Posts: 96
Threads: 25
Joined: Aug 2009
Reputation:
0
@Bella: Good question, haven't used weapons in gta a long time now... You could check for WeaponState 2 instead of 1 (Last bullet instead of empty weapon) and save the weaponid in a PVar for the player. and with /reload the weapon saved within the PVar gets reloaded.