27.12.2011, 10:56
Hi guys, some of you want to know how to be able to detect a joypad with a simple code. It may be a little inaccurate within the first 30 seconds of your very first spawn but once it's found if it's joypad or not it's fine.
http://pastie.org/private/uvbn3ydj8jkcxtcwdmjy1q
http://pastebin.com/RGtPuDGS
I've included an example in the pastie but here it is anyhow:
Enjoy.
http://pastie.org/private/uvbn3ydj8jkcxtcwdmjy1q
http://pastebin.com/RGtPuDGS
I've included an example in the pastie but here it is anyhow:
pawn Код:
public OnPlayerSpawn(playerid)
{
if(!JoypadDetect(playerid)) { printf("id %d is NOT using a joypad."); }
else { printf("id %d IS using a joypad."); }
}