Gun changing +Rep
#1

i want to make it like:if i shot using a gun ,it writes hold under the gun and then i cant change weapon,like if i shot 1 shot to the sky and i changed the weapon it will put it back to the shotgun,this will be for 5 seconds,i mean disable changing for 5 seconds then the hold disappears and he can change it
can someone help?
Reply
#2

gun changing is client sided you cannot block client sided
with server sided scripts
Reply
#3

Quote:
Originally Posted by ReApZ
Посмотреть сообщение
gun changing is client sided you cannot block client sided
with server sided scripts
maybe he wants prevent something like c-bug
Reply
#4

the facts remain dont they?
Reply
#5

How do u say that i cant and i have already saw it in a rp server ,it's to avoid chicken running,if u shot using a gun u cant change it only after 5 seconds,
Reply
#6

you cant stop it from changing but you can remove all others + fist for the 5 seconds which is the same thing
Reply
#7

I think it might be possible... i will edit my post for the script..
Reply
#8

took from samp wiki

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);
}
you can do something with this if possible.
Reply
#9

Quote:
Originally Posted by Champ
Посмотреть сообщение
took from samp wiki

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);
}
you can do something with this if possible.
maybe timer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)