How to makes that player can't shot - 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: How to makes that player can't shot (
/showthread.php?tid=476088)
How to makes that player can't shot -
CrossOv3r - 16.11.2013
Player Can't Shot
їHow can I make, that a player can't shot his weapon?.
I had been trying with "ClearAnimations", "TogglePlayerControllable". But not works.
Any have an idea of how can I make it?
Thanks for your attention.
Re: How to makes that player can't shot -
Voxel - 16.11.2013
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
new x, y, z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+1);
//or try this: ResetPlayerWeapons(playerid);
}
return 1;
}
not sure if that would work but give it a try
!
or just simply dont give them a weapon ._.??: ResetPlayerWeapons(playeridid);
Respuesta: Re: How to makes that player can't shot -
CrossOv3r - 16.11.2013
Quote:
Originally Posted by Voxel
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_FIRE)) { new x, y, z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); //or try this: ResetPlayerWeapons(playerid); } return 1; }
not sure if that would work but give it a try !
or just simply dont give them a weapon ._.??: ResetPlayerWeapons(playeridid);
|
Tested, but doesn't works
It's worst than ever, when you hit too many times the KEY_FIRE doesn't shot, but when you release the button, then you can shot normal.
The shot is just cancelled when you hit constantly, if you just hit the KEY 1 time, or at ending of the pressing the key, it fires
Thanks , anyway.
Re: How to makes that player can't shot -
Konstantinos - 16.11.2013
Check if KEY_FIRE is being pressed or held and set as armed weapon the fist. This may work.
So instead of getting and setting the position, use:
pawn Код:
SetPlayerArmedWeapon( playerid, 0 );