Gun changing +Rep - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gun changing +Rep (
/showthread.php?tid=479159)
Gun changing +Rep -
iBots - 03.12.2013
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?
Re: Gun changing +Rep -
ReApZ - 03.12.2013
gun changing is client sided you cannot block client sided
with server sided scripts
Re: Gun changing +Rep -
novan - 03.12.2013
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
Re: Gun changing +Rep -
ReApZ - 03.12.2013
the facts remain dont they?
Re: Gun changing +Rep -
iBots - 03.12.2013
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,
Re: Gun changing +Rep -
ReApZ - 03.12.2013
you cant stop it from changing but you can remove all others + fist for the 5 seconds which is the same thing
Re: Gun changing +Rep -
newbie scripter - 03.12.2013
I think it might be possible... i will edit my post for the script..
Re: Gun changing +Rep -
Champ - 03.12.2013
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.
Re: Gun changing +Rep -
novan - 03.12.2013
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.