Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new UsingJoypad[MAX_SERVER_SLOTS];
- public OnPlayerConnect(playerid)
- {
- UsingJoypad[playerid] = 0;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(UsingJoypad[playerid] == 0) {
- new keys, updown, leftright;
- GetPlayerKeys (playerid, keys, updown, leftright);
- if((updown != 128 && updown != 0 && updown != -128) || (leftright != 128 && leftright != 0 && leftright != -128)) {
- UsingJoypad[playerid] = 1;
- }
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(!JoypadDetect(playerid)) { printf("id %d is NOT using a joypad."); }
- else { printf("id %d IS using a joypad."); }
- }
- stock JoypadDetect(playerid)
- {
- if(UsingJoypad[playerid] == 0) return 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement