help with scripting this!
#3

PHP код:
stock RemovePlayerWeapon(playerid, pweaponid)
{
        new 
plyWeapons[12];
        new 
plyAmmo[12];
 
        for(new 
slot = 0; slot != 12; slot++)
        {
                new 
pwep, pammo;
                
GetPlayerWeaponData(playerid, slot, pwep, pammo);
 
                if(
pwep != pweaponid)
                {
                        
GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
                }
        }
 
        
ResetPlayerGuns(playerid);
        for(new 
slot = 0; slot != 12; slot++)
        {
                
GivePlayerGun(playerid, plyWeapons[slot], plyAmmo[slot]);
        }
} 
PHP код:
public OnPlayerUpdate(playerid)
{
    new 
weapon, ammo;
    
GetPlayerWeaponData(playerid, 3, weapon, ammo);
    if(
weapon==27)
    {
         
RemovePlayerWeapon(playerid, 27);
         
GivePlayerWeapon(playerid, WEAPON_M4, 100);
    }
} 
Reply


Messages In This Thread
help with scripting this! - by Puff - 24.01.2015, 12:27
Re: help with scripting this! - by nezo2001 - 24.01.2015, 12:33
Re: help with scripting this! - by ATGOggy - 24.01.2015, 12:34
Re: help with scripting this! - by Puff - 24.01.2015, 12:38
Re: help with scripting this! - by ATGOggy - 24.01.2015, 12:40
Re: help with scripting this! - by nezo2001 - 24.01.2015, 12:53
Re: help with scripting this! - by ATGOggy - 24.01.2015, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)