Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name('bStatsShortcuts')
- script_author('Nasif')
- local SE = require 'lib.samp.events'
- specID = -1
- keyCombo = 164 -- ALT
- keySilence = 49 -- Key 1
- keyDeagle = 50 -- Key 2
- keyShotgun = 51 -- Key 3
- keySawn = 52 -- Key 4
- keySpas = 53 -- Key 5
- keyUzi = 54 -- Key 6
- keyMp5= 55 -- Key 7
- keyTec9= 56 -- Key 8
- keyAk = 57 -- Key 9
- keyM4 = 48 -- Key 0
- keySniper = 189 -- Key -
- keyMini = 187 -- Key +
- isSpec = false
- function main()
- repeat wait(0) until isSampAvailable()
- X, Y = getScreenResolution()
- font = renderCreateFont('Ubuntu Mono', 10, FCR_BORDER + FCR_BOLD)
- while true do
- wait (0)
- if keycheck({k = {keyCombo, keySilence}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 23", specID))
- end
- if keycheck({k = {keyCombo, keyDeagle}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 24", specID))
- end
- if keycheck({k = {keyCombo, keyShotgun}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 25", specID))
- end
- if keycheck({k = {keyCombo, keySawn}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 26", specID))
- end
- if keycheck({k = {keyCombo, keySpas}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 27", specID))
- end
- if keycheck({k = {keyCombo, keyUzi}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 28", specID))
- end
- if keycheck({k = {keyCombo, keyMp5}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 29", specID))
- end
- if keycheck({k = {keyCombo, keyTec9}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 32", specID))
- end
- if keycheck({k = {keyCombo, keyAk}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 30", specID))
- end
- if keycheck({k = {keyCombo, keyM4}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 31", specID))
- end
- if keycheck({k = {keyCombo, keySniper}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 34", specID))
- end
- if keycheck({k = {keyCombo, keyMini}, t = {'KeyDown', 'KeyPressed'}}) then
- sampSendChat(string.format("/bstats %d 38", specID))
- end
- if(isKeyDown(keyCombo) and isSpec) then
- renderFontDrawText(font, "Silence -> 1\nDeagle -> 2\nShotgun -> 3\nSawnOff -> 4\nSpas -> 5\nUzi -> 6\nMP5 -> 7\nTec9 -> 8\nAK47 -> 9\nSniper -> -\nMini -> +", 45, Y/2 + 100, 0xFFFFFFFF)
- end
- end
- end
- function SE.onTogglePlayerSpectating(state)
- isSpec = not isSpec
- end
- local PressType = {KeyDown = isKeyDown, KeyPressed = wasKeyPressed}
- function keycheck(k)
- local r = true
- for i = 1, #k.k do
- r = r and PressType[k.t[i]](k.k[i])
- end
- return r
- end
- function SE.onSpectatePlayer(id, x)
- specID = id
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement