Best-Killer
Members-
Posts
494 -
Joined
-
Last visited
Everything posted by Best-Killer
-
Vehicle doesn't have an data over there,you gotta give it a data addEvent("givePVehicle", true) addEventHandler( "givePVehicle", root, function() local vehicle = createVehicle (482,1605.42, -1472.97, 13.58,0,0,0) setElementData (vehicle, "OwnerOfThisVehicle", source) warpPedIntoVehicle(source, vehicle) end ) function removePVehicle ( player, seat, jacked ) local vehicle = getPedOccupiedVehicle ( player ) if getElementData (vehicle, "OwnerOfThisVehicle") == source then destroyElement (vehicle) end end addEvent ("removePVehicle",true) addEventHandler ( "removePVehicle", root, removePVehicle ) Work Thanks u
-
how i can learn without forum help ?? GTFO man Fucking Haters it's not your problem if i create a post or no Leave me pls
-
addEvent("givePVehicle", true) addEventHandler( "givePVehicle", root, function() local vehicle = createVehicle (482,1605.42, -1472.97, 13.58,0,0,0) setElementData (vehicle, "OwnerOfThisVehicle", source) warpPedIntoVehicle(source, vehicle) end ) function removePVehicle ( vehicle, seat, jacked ) if getElementData (vehicle, "OwnerOfThisVehicle") == source then destroyElement (vehicle) end end addEvent ("removePVehicle",true) addEventHandler ( "removePVehicle", root, removePVehicle ) line 11 argument 1 got nill
-
attempt to call global 'findPlayer' a nill value)
Best-Killer replied to Best-Killer's topic in Scripting
addCommandHandler("setplaytime", function (source, _, findPlayer, h, min) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Owner")) then if findPlayer then if getPlayerFromNamePart2(findPlayer) then local findPlayer = getPlayerFromNamePart2(findPlayer) t[findPlayer(findPlayer)] = {["hours"] = tonumber(h), ["min"] = tonumber(min), ["sec"] = 0} end end end end) addCommandHandler ( "playtime", function ( p ) if ( not pt [ p ] ) then pt [ p ] = 0 end exports.SAEGMessages:sendClientMessage ( "You have a total of "..tostring(pt[p]).." minutes of online-time at SAEG:RPG", p, 0, 255, 0 ) end ) function getPlayerFromNamePart2 ( name ) --MY EPIC PLAYER FIND PART if ( name ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local name_ = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ):lower ( ) if name_:find ( tostring ( name ):lower ( ), 1, true ) then return player end end end end i got : attempt to call local findPlayer (a userdata value) -
"Sir.BEEF" type="script" version="1.0" name="nameOftheScript" />
-
attempt to call global 'findPlayer' a nill value)
Best-Killer replied to Best-Killer's topic in Scripting
function getPlayerFromNamePart ( str ) if ( str ) then local players = { } for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( string.find ( string.lower ( getPlayerName ( v ) ), string.lower ( str ) ) ) then table.insert ( players, v ) end end if ( #players == 0 or #players > 1 ) then return false end return players[1] end return false end -
attempt to call global 'findPlayer' a nill value) local pt = { } exports.scoreboard:scoreboardAddColumn ( "Playtime", root, 50 ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for i, v in pairs ( getElementsByType ( "player" ) ) do pt [ v ] = 0 local x = tonumber ( getElementData ( v, "PlayerFunct:HiddenPTMins" ) ) if ( x ) then pt [ v ] = x end end end ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) for i, v in pairs ( getElementsByType ( "player" ) ) do local x = 0 if ( pt [ v ] ) then x = pt [ v ] end setElementData ( v, "PlayerFunct:HiddenPTMins", x ) end end ) setTimer ( function ( ) for i, v in pairs ( getElementsByType ( "player" ) ) do if ( not pt [ v ] ) then pt [ v ] = 0 end pt [ v ] = pt [ v ] + 1 updatePlayerPlaytime ( v ) end end, 60000, 0 ) function updatePlayerPlaytime ( v) if ( not ( pt [ v ] ) ) then return false end return setElementData ( v, "Playtime", tostring ( convertMinsToActualTime ( pt [ v ] ) ) ) end function deletePlayerPlaytime ( p ) if ( p and pt [ p ] ) then pt [ p ] = nil return true end return false end function setPlayerPlaytime ( p, m ) if ( p and m ) then pt [ p ] = m updatePlayerPlaytime ( p ) return true end return false end function getPlayerPlaytime ( p ) if ( p and pt [ p ] ) then return pt [ p ] end return false end function convertMinsToActualTime ( m ) local hours = 0 while ( m >= 60 ) do m = m - 60 hours = hours + 1 end -- Minutes only if ( hours == 0 ) then return tostring(m).."m" -- Hours and minutes elseif ( hours > 0 ) then return tostring(hours)..":" ..tostring(m).."" end end addCommandHandler("setplaytime", function (source, _, who, h, min) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Owner")) then if findPlayer(who) then if getPlayerFromNamePart(who) then local findPlayer = exports.SAEGPlayerFunctions:getPlayerFromNamePart(who) t[findPlayer(who)] = {["hours"] = tonumber(h), ["min"] = tonumber(min), ["sec"] = 0} end end end end) addCommandHandler ( "playtime", function ( p ) if ( not pt [ p ] ) then pt [ p ] = 0 end exports.SAEGMessages:sendClientMessage ( "You have a total of "..tostring(pt[p]).." minutes of online-time at SAEG:RPG", p, 0, 255, 0 ) end ) Line 92
-
i know how to draw a text but i want know right functions/events to make the loc system and the important thing is : draw an arrow above the player who is locating pointing to the located one. at least tell me how to draw an arrow above the player who is locatining pointing to the located one . or give me the right events/function of all script if you can and thanks u
-
if you're a cop and me a criminal when i use taser to tas you (the cop) the taser work i want it not work
-
Calm down, he just asked you to try something go to wiki read abit... and after all none here is your personal scripting assistant. so be nice i know Kariiim but i said in post example i don't tell anyone for do it for me somthing i said just i want example (what i need EVENTS/Functions -Client-Server Side) that what i want but it's ok thanks all
-
Are You Fucking Kidding me ? -.- how i can start it and i don't know what i need from Functions/events ??? can answer ?? tell me what i need Functions/Event or don't post anything -.- Not you karim i'm talking with that guy -.- Bonsai
-
i want make locate player system : It should draw dx text with the located player location info, the orientation and the meters. draws too an arrow above the player who is locating pointing to the located one. any example ?
-
local sWidth,sHeight = guiGetScreenSize() if isPedInVehicle(localPlayer) then vehicle = getPedOccupiedVehicle(localPlayer) health = math.ceil ( getElementHealth ( vehicle ) / bad argument getElemanthealth expected element at argument 1 got boolean
-
With that code : --[[ ########################################################################## ## ## ## Project: 'Taser' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke ]] local cFunc = {} local cSetting = {} cSetting["shots"] = {} cSetting["shot_calcs"] = {} local last_shot = 1 -- FUNCTIONS -- PoliceTeam = {["Law Enforcement"] = true} cFunc["render_shots"] = function() for index, tbl in pairs(cSetting["shots"]) do HitCoord(tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6], tocolor(0, 255, 0)) end end cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2) table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2}) -- SHOT CALCULATING local lastx, lasty, lastz = x1, y1, z1 local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) cSetting["shot_calcs"][last_shot] = {} for i = 1, dis, 0.5 do -- cSetting["shot_calcs"][i] = nx, ny, nz -- cSetting["shot_calcs"][last_shot][i] = end last_shot = last_shot+1 end cFunc["shot_weapon"] = function(hitX, hitY, hitZ, x, y, z) if not PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then return end if PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then playSound3D("data/Fire.wav", x, y, z) local s = playSound3D("data/Fire.wav", hitX, hitY, hitZ) setSoundMaxDistance(s, 50) for i = 1, 5, 1 do fxAddPunchImpact(hitX, hitY, hitZ, 0, 0, 0) fxAddSparks(hitX, hitY, hitZ, 0, 0, 0, 8, 1, 0, 0, 0, true, 3, 1) end cFunc["draw_shot"](x, y, z, hitX, hitY, hitZ) fxAddPunchImpact(x, y, z, 0, 0, -3) end end cFunc["wait_shot"] = function() toggleControl("fire", false) setTimer(function() toggleControl("fire", true) end, 350, 1) end cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ) if not PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then return end if(wp == 23) and PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) if(source == localPlayer) then cFunc["wait_shot"]() end end end HitCoord = function(x1, y1, z1, x2, y2, z2, color) local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) local lastx, lasty, lastz = x1, y1, z1 --for i = 1, dis, 3 do -- dxDrawLine3D(x1, y1, z1, x2, y2, z2) --end end cFunc["anim_check"] = function(_, wep, bodypart) if not PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then return end if PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 10000, false, true, false) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 10000, false, true, false) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 10000, false, true, false) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) end end end -- EVENT HANDLER -- addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"]) if i'm in police team and you're criminal i can tass you (work fine) if i'm in police team and you're criminal you can tass me (On) I want : if i'm in police team and you're criminal you can tass me (Off)
-
if i'm a cop and the player criminal or somthing and he tas me the taser work i want if i'm a cop and the player criminal or anyother team only the taser not work pls help
-
New Code : --[[ ########################################################################## ## ## ## Project: 'Taser' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke ]] local cFunc = {} local cSetting = {} cSetting["shots"] = {} cSetting["shot_calcs"] = {} local last_shot = 1 -- FUNCTIONS -- PoliceTeam = {["Law Enforcement"] = true} cFunc["render_shots"] = function() for index, tbl in pairs(cSetting["shots"]) do HitCoord(tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6], tocolor(0, 255, 0)) end end cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2) table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2}) -- SHOT CALCULATING local lastx, lasty, lastz = x1, y1, z1 local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) cSetting["shot_calcs"][last_shot] = {} for i = 1, dis, 0.5 do -- cSetting["shot_calcs"][i] = nx, ny, nz -- cSetting["shot_calcs"][last_shot][i] = end last_shot = last_shot+1 end cFunc["shot_weapon"] = function(hitX, hitY, hitZ, x, y, z) if not PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then return end if PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then playSound3D("data/Fire.wav", x, y, z) local s = playSound3D("data/Fire.wav", hitX, hitY, hitZ) setSoundMaxDistance(s, 50) for i = 1, 5, 1 do fxAddPunchImpact(hitX, hitY, hitZ, 0, 0, 0) fxAddSparks(hitX, hitY, hitZ, 0, 0, 0, 8, 1, 0, 0, 0, true, 3, 1) end cFunc["draw_shot"](x, y, z, hitX, hitY, hitZ) fxAddPunchImpact(x, y, z, 0, 0, -3) end end cFunc["wait_shot"] = function() toggleControl("fire", false) setTimer(function() toggleControl("fire", true) end, 350, 1) end cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ) if not PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then return end if(wp == 23) and PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) if(source == localPlayer) then cFunc["wait_shot"]() end end end HitCoord = function(x1, y1, z1, x2, y2, z2, color) local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) local lastx, lasty, lastz = x1, y1, z1 --for i = 1, dis, 3 do -- dxDrawLine3D(x1, y1, z1, x2, y2, z2) --end end cFunc["anim_check"] = function(_, wep, bodypart) if not PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then return end if PoliceTeam[getTeamName(getPlayerTeam(getLocalPlayer( )))] then if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 10000, false, true, false) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 10000, false, true, false) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 10000, false, true, false) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) end end end -- EVENT HANDLER -- addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"]) but other players can use taser too pls help
-
again SAEGPlayerFunctions:isTeamLaw' STRING "?"
-
--[[ ########################################################################## ## ## ## Project: 'Taser' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke ]] local player = getElementsByType ( "player" ) local cFunc = {} local cSetting = {} cSetting["shots"] = {} cSetting["shot_calcs"] = {} local last_shot = 1 local a = cop -- FUNCTIONS -- cFunc["render_shots"] = function() for index, tbl in pairs(cSetting["shots"]) do HitCoord(tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6], tocolor(0, 255, 0)) end end cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2) table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2}) -- SHOT CALCULATING local lastx, lasty, lastz = x1, y1, z1 local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) cSetting["shot_calcs"][last_shot] = {} for i = 1, dis, 0.5 do -- cSetting["shot_calcs"][i] = nx, ny, nz -- cSetting["shot_calcs"][last_shot][i] = end last_shot = last_shot+1 end cFunc["shot_weapon"] = function(hitX, hitY, hitZ, x, y, z) if ( exports.SAEGPlayerFunctions:isTeamLaw (getPlayerTeam(getLocalPlayer()))) then playSound3D("data/Fire.wav", x, y, z) local s = playSound3D("data/Fire.wav", hitX, hitY, hitZ) setSoundMaxDistance(s, 50) for i = 1, 5, 1 do fxAddPunchImpact(hitX, hitY, hitZ, 0, 0, 0) fxAddSparks(hitX, hitY, hitZ, 0, 0, 0, 8, 1, 0, 0, 0, true, 3, 1) end cFunc["draw_shot"](x, y, z, hitX, hitY, hitZ) fxAddPunchImpact(x, y, z, 0, 0, -3) end end cFunc["wait_shot"] = function() toggleControl("fire", false) setTimer(function() toggleControl("fire", true) end, 350, 1) end cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ) if(wp == 23) and ( exports.SAEGPlayerFunctions:isTeamLaw (getPlayerTeam(getLocalPlayer()))) then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) if(source == localPlayer) then cFunc["wait_shot"]() end end end HitCoord = function(x1, y1, z1, x2, y2, z2, color) local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) local lastx, lasty, lastz = x1, y1, z1 --for i = 1, dis, 3 do -- dxDrawLine3D(x1, y1, z1, x2, y2, z2) --end end cFunc["anim_check"] = function(_, wep, bodypart) local t = getPlayerTeam () if ( exports.SAEGPlayerFunctions:isTeamLaw (getPlayerTeam(getLocalPlayer()))) then if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 10000, false, true, false) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 10000, false, true, false) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 10000, false, true, false) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false) end end end -- EVENT HANDLER -- addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"]) 80/62 call : failed to call SAEGPlayerFunctions:isTeamLaw' STRING "?"
-
Thanks all i will try it
-
ok guys no one want do it for me so give me some example or idea to do it pls guys
-
What about try doing it by yourself? and post what you've done with and keep your money to you. i don't have idea to do it pls help me for it or give me eample or somthing
-
Guys i swear who will do that for me i will pay 3$
