OnPlayerSwitchWeapon
#1

Anything like that excists?

I want to make that if a players uses a weapon that he/she has not attached to their body (attaching already made) the weapon goes back and he/she cant use it
Reply
#2

I'll make you a function for that, give me 5 minutes.
Reply
#3

Quote:
Originally Posted by iRage
Посмотреть сообщение
I'll make you a function for that, give me 5 minutes.
Aight that would be awesome
Reply
#4

Actually this thread has one, if it doesn't work tell me.
https://sampforum.blast.hk/showthread.php?tid=24671
Reply
#5

Easy to make, put this into your script:

pawn Код:
new lastWeapon[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    lastWeapon[playerid] = 0;
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new w = GetPlayerWeapon(playerid);
    if(w != lastWeapon[playerid])
    {
        OnPlayerChangeWeapon(playerid, w, lastWeapon[playerid]);
    }
    lastWeapon[playerid] = w;
    return 1;
}

OnPlayerChangeWeapon(playerid, newgun, oldgun)
{
    return 1;
}
Reply
#6

Thanks both
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)