Spectate
#1

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!
Reply
#2

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.
Reply
#3

Код:
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
	if(newkeys == KEY_AIM)//Right Mouse
	{
	    ReverseSpectate(playerid);
	}
	if(newkeys == KEY_FIRE)//Left Mouse
	{
	    NextSpectate(playerid);
	}
}
Reply
#4

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)
Reply
#5

Not good? The Left Mouse button is working but only not right button.
maybe there is a other defined Key code?
Reply
#6

bump
Reply
#7

Anyone?
Reply
#8

bump
Reply
#9

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."
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)