On Player Switch Weapon[REWARD:REP+]
#1

On Player Switch Weapon
Anyway I can get near to this ?Maybe a Call back?

[REWARD]:REP+

Reply
#2

How About This? I got this from wiki :
PHP код:
public OnPlayerUpdate(playerid)
{
    new 
iCurWeap GetPlayerWeapon(playerid); // Return the player's current weapon        
    
if(iCurWeap != GetPVarInt(playerid"iCurrentWeapon")) // If he changed weapons since the last update
    
{
        
// Lets call a callback named OnPlayerChangeWeapon
        
OnPlayerChangeWeapon(playeridGetPVarInt(playerid"iCurrentWeapon"), iCurWeap);
        
SetPVarInt(playerid"iCurrentWeapon"iCurWeap);//Update the weapon variable
    
}
    return 
1// Send this update to other players.
}
 
stock OnPlayerChangeWeapon(playeridoldweaponnewweapon)
{
    new     
s[128],
        
oWeapon[24],
        
nWeapon[24];
 
    
GetWeaponName(oldweaponoWeaponsizeof(oWeapon));
    
GetWeaponName(newweaponnWeaponsizeof(nWeapon));
 
    
format(ssizeof(s), "You changed weapon from %s to %s!"oWeaponnWeapon);
 
    
SendClientMessage(playerid0xFFFFFFFFs);

link : https://sampwiki.blast.hk/wiki/OnPlayerUpdate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)