I need a little help with this, does anyone know correct way to detect player keys?
I already made something but I got error
Code: Select all
Event onPlayerKeyPress: attempt to call a number value
Code: Select all
Event onPlayerKeyPress: attempt to call a number value
Code: Select all
function keyHook(playerId, virtualKey, isKeyUp)
local i = 0
if isKeyUp then i = 1 end
sendPlayerMsg(playerId, "Key " .. virtualKey .. " status: " .. i, 0xFFFF0000)
end
registerEvent("keyHook", "onPlayerKeyPress")
function playerSpawnCredentials(playerid)
--Whatever code you wanna have here
setPlayerKeyHook(playerid, 0x41, true) -- 0x41 is the A key
end
registerEvent("playerSpawnCredentials", "onPlayerCredential")
Users browsing this forum: No registered users and 0 guests