OnPlayerSwitchWeapon?
#10

Quote:
Originally Posted by antixgaming
Посмотреть сообщение
pawn Код:
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(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap);
        SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);//Update the weapon variable
    }
    return 1; // Send this update to other players.
}
 
stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
{
    new     s[128],
        oWeapon[24],
        nWeapon[24];
 
    GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon));
    GetWeaponName(newweapon, nWeapon, sizeof(nWeapon));
 
    format(s, sizeof(s), "You changed weapon from %s to %s!", oWeapon, nWeapon);
 
    SendClientMessage(playerid, 0xFFFFFFFF, s);
}
From SAMP's wiki.
Already tried that, read the comments below.
Reply


Messages In This Thread
OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 14:35
Re: OnPlayerSwitchWeapon? - by Bolex_ - 22.03.2019, 14:50
Re: OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 15:08
Re: OnPlayerSwitchWeapon? - by Kaliber - 22.03.2019, 15:14
Re: OnPlayerSwitchWeapon? - by antixgaming - 22.03.2019, 16:17
Re: OnPlayerSwitchWeapon? - by m4karow - 22.03.2019, 16:34
Re: OnPlayerSwitchWeapon? - by NaS - 22.03.2019, 17:04
Re: OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 17:15
Re: OnPlayerSwitchWeapon? - by antixgaming - 22.03.2019, 18:16
Re: OnPlayerSwitchWeapon? - by Marshas - 22.03.2019, 20:52
Re: OnPlayerSwitchWeapon? - by antixgaming - 22.03.2019, 21:50
Re: OnPlayerSwitchWeapon? - by Marshas - 23.03.2019, 15:41

Forum Jump:


Users browsing this thread: 1 Guest(s)