Guel
Member
I want to remove the "_" in the name and get the weapon name I'm holding in the output, here's the code.
need help for the output: /me gets his ((the weapon im holding)) and shoots ((player ID im pointing to without underscore)) in the head.
need help for the output: /me gets his ((the weapon im holding)) and shoots ((player ID im pointing to without underscore)) in the head.
Code:
require "moonloader"
require "sampfuncs"
local sampev = require "lib.samp.events"
local key = require 'vkeys'
local encoding = require "encoding"
encoding.default = 'CP1251'
u8 = encoding.UTF8
local vkeys = require 'vkeys'
script_name("AimVest")
script_author("SA:MP Squad")
function main()
while not isSampAvailable() do wait(50) end
sampAddChatMessage("AimRP By {33CCFF}Migeru from {7289da}Hanako-Kai, {FF0000}Press Aim+Q to {FFA500}RP.", -1)
while true do
if not (sampIsChatInputActive() or sampIsDialogActive() or isSampfuncsConsoleActive()) then
local res, tPlayer = getCharPlayerIsTargeting(playerHandle)
if res and isKeyJustPressed(vkeys.VK_Q) then
wait(500)
local result, playerid = sampGetPlayerIdByCharHandle(tPlayer)
name = sampGetPlayerNickname(playerid)
if result then
sampSendChat("/me gets his deagle and shoots " .. name .. " in the head.")
end
end
end
wait(0)
end
end