Reset Weapon Data
#1

Hi everyone. My system is used ammunition. There are 2 errors when using this system. Example: I have a border with 24/7 Deagle member. When I shot all my escape or to a car, I would have to import Deagle with bullets as on



Reply
#2

Are you trying to say:
Your server has members who use deagle 24/7 and you want to reset their weapon when they enter a vehicle and set the ammo back to the number with which they entered the vehicle when they exit?
Reply
#3

I come from Vietnam. My English is very poor. Expect sympathy
Reply
#4

PHP Code:
#include <a_samp>
new WeaponAmmo[MAX_PLAYERS];
public 
OnPlayerEnterVehicle(playeridvehicleid)
{
    new 
weapons[2];
    
GetPlayerWeaponData(playerid2weapons[0], weapons[1]);
    
WeaponAmmo[playerid]=weapons[1];
    
ResetPlayerWeapons(playerid);
    return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    
GivePlayerWeapon(playerid24WeaponAmmo[playerid]);
}
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
weaponid==24 &&GetPlayerAmmo(playerid)<=7)
    {
        
SetPlayerAmmo(playerid24100);
    }

Reply
#5

Thank you, I will try your example
Reply
#6

I've tried. The code you help me inactivity. I'm in the car, bullets in the gun was returned to the original.Who can help me this problem ?
Reply
#7

Help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)