Code don't work
#1

I've this code to check if player has joypad:

pawn Код:
new JoyPadders[MAX_PLAYERS];

OnPlayerUpdate(playerid) {
    if(JoyPadders[playerid] == 0) {
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        if((ud != 128 && ud != 0 && ud != -128) || (lr != 128 && lr != 0 && lr != -128))
        JoyPadders[playerid] = 1;
        SendClientMessage(playerid, COLOR_GREEN, "Joypad detected,freezed.");
        TogglePlayerControllable(playerid,0);
        else
       //nothing.
    }
}
I tried to use joypad but the script doesn't freeze me and doesn't show that message,what's wrong?
Reply
#2

obviously the script doesn't detect the joypad thats why it doesn't work.
Reply
#3

Quote:
Originally Posted by wildcookie007
Посмотреть сообщение
obviously the script doesn't detect the joypad thats why it doesn't work.
Don't reply in things you don't know about....This DOES detect joypad...I've even tested it myself with whitetiger...It's even in Deadly Combinations A/D -_- The reason it works is because the spectrum of joypads is much larger than the spectrum of WASD

https://sampforum.blast.hk/showthread.php?tid=254295

pawn Код:
new JoyPadders[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    if(JoyPadders[playerid] == 0) {
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        if((ud != 128 && ud != 0 && ud != -128) || (lr != 128 && lr != 0 && lr != -128))
        JoyPadders[playerid] = 1;
        SendClientMessage(playerid, COLOR_GREEN, "Joypad detected,freezed.");
        TogglePlayerControllable(playerid,0);
    }
}
Try that...(this is if you actually did forget the public in front of onplayerupdate)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)