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(playerid, vehicleid)
{
    new 
weapons[2];
    
GetPlayerWeaponData(playerid, 2, weapons[0], weapons[1]);
    
WeaponAmmo[playerid]=weapons[1];
    
ResetPlayerWeapons(playerid);
    return 
1;
}
public 
OnPlayerExitVehicle(playerid, vehicleid)
{
    
GivePlayerWeapon(playerid, 24, WeaponAmmo[playerid]);
}
public 
OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(
weaponid==24 &&GetPlayerAmmo(playerid)<=7)
    {
        
SetPlayerAmmo(playerid, 24, 100);
    }
} 
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)