Spectate - 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: Spectate (
/showthread.php?tid=371237)
Spectate -
NeverKnow - 22.08.2012
I have a spectate system in my Gm.
Left / right mouse buttons to switch from players.
but the right mouse button doesn't work.
I tried to #define KEY_AIM 128 and #define KEY_AIM 132 and its still not working.
[FIXED]
Edit: Other Problem:
Player ID 0 Crash alltimes on Spectate mode when he press FireButton Either Left Mouse Button..
This only happens if you are ID 0.
Can Someone Help me out?
Thanks!
Re: Spectate -
Roko_foko - 22.08.2012
Can you show us the code where you use keys( OnPlayerKeyStateChange ).
In addition, I see alternative to this. you can make two buttons with Clickable TextDraws as well.
Re: Spectate -
NeverKnow - 22.08.2012
Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
if(newkeys == KEY_AIM)//Right Mouse
{
ReverseSpectate(playerid);
}
if(newkeys == KEY_FIRE)//Left Mouse
{
NextSpectate(playerid);
}
}
Re: Spectate -
Roko_foko - 22.08.2012
Quote:
Originally Posted by NeverKnow
Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
if(newkeys == KEY_AIM)//Right Mouse
{
ReverseSpectate(playerid);
}
if(newkeys == KEY_FIRE)//Left Mouse
{
NextSpectate(playerid);
}
}
|
This isn't good. (
OnPlayerKeyStateChange-how NOT to check for a key)
Re: Spectate -
NeverKnow - 22.08.2012
Not good? The Left Mouse button is working but only not right button.
maybe there is a other defined Key code?
Re: Spectate -
NeverKnow - 06.09.2012
bump
Re: Spectate -
NeverKnow - 08.09.2012
Anyone?
Re: Spectate -
NeverKnow - 24.09.2012
bump
Re: Spectate -
clarencecuzz - 24.09.2012
Try this:
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
if(newkeys == KEY_HANDBRAKE)//Right Mouse
{
ReverseSpectate(playerid);
}
if(newkeys == KEY_FIRE)//Left Mouse
{
NextSpectate(playerid);
}
}
https://sampwiki.blast.hk/wiki/GetPlayerKeys explains that "KEY_AIM is undefined in SA-MP includes. You can either define it yourself or use KEY_HANDBRAKE."
Re: Spectate -
NeverKnow - 28.09.2012
Quote:
Originally Posted by clarencecuzz
Try this:
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) { if(newkeys == KEY_HANDBRAKE)//Right Mouse { ReverseSpectate(playerid); } if(newkeys == KEY_FIRE)//Left Mouse { NextSpectate(playerid); } }
https://sampwiki.blast.hk/wiki/GetPlayerKeys explains that "KEY_AIM is undefined in SA-MP includes. You can either define it yourself or use KEY_HANDBRAKE."
|
This Works Perfects! Thank you very much, but now i have a other problem =/
Player ID 0 Crash alltimes on Spectate mode when he press FireButton Either Left Mouse Button..
This only happens if you are ID 0.
Can someone please help me out with this
Thanks!