Best-Killer
Members-
Posts
494 -
Joined
-
Last visited
Everything posted by Best-Killer
-
how to make taser work only for Cops ?? using that script : https://community.multitheftauto.com/in ... ls&id=7261 Clinet-side : --[[ ########################################################################## ## ## ## 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 -- cFunc["render_shots"] = function() for index, tbl in pairs(cSetting["shots"]) do dxDrawFuckedLine3D(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) 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 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) then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) if(source == localPlayer) then cFunc["wait_shot"]() end end end dxDrawFuckedLine3D = 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(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 10000, false, true, false) elseif(wep == 23) and (bodypart == -- s8) --> then setPedAnimation(source, "CRACK", "crckdeth2", 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 -- 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"])
-
Thanks But It's Sloved 3 minute ago hhh But Thanks You :*
-
Guys Please help i need it urgent
-
your code 0 errors but stats not saved that full code : data={}; function onStart() for i=0,9 do data[i] = {}; end data[0].weapon="Sniper" data[1].weapon="Taser" data[2].weapon="Pistol" data[3].weapon="MP5" data[4].weapon="Deagle" data[5].weapon="Ak-47" data[6].weapon="M4" data[7].weapon="Uzi/TEC-9" data[8].weapon="Sawn-Off" data[9].weapon="ShotGun" data[0].ammo=6000 data[1].ammo=2500 data[2].ammo=3000 data[3].ammo=3500 data[4].ammo=4500 data[5].ammo=4500 data[6].ammo=5000 data[7].ammo=5000 data[8].ammo=5500 data[9].ammo=5500 data[0].id=79 data[1].id=70 data[2].id=69 data[3].id=76 data[4].id=71 data[5].id=77 data[6].id=78 data[7].id=75 data[8].id=73 data[9].id=72 end addEvent("skill:inc",true) guimarker = createMarker ( 840.81, 859.91, 13.04, "cylinder", 1.5, 255, 255, 0, 90 ) listing = createBlipAttachedTo(guimarker,8) function showSkillsgui ( uPlayer ) onStart(); triggerClientEvent ( uPlayer, "openGView", root ) end addEventHandler ( "onMarkerHit", guimarker, showSkillsgui ) function incSkill( player ,ik) stats = { [data[ik].id] = 1000; } if getPlayerMoney(player) >= data[ik].ammo then for stat,value in pairs(stats) do setPedStat(player, stat, value) end takePlayerMoney(player,data[ik].ammo) outputChatBox("success"); else outputChatBox("not enough money",player) end end addEventHandler ( "skill:inc", root, incSkill ) function onPlayerQuit () local account = getPlayerAccount(source) if (playeraccount) and not isGuestAccount (playeraccount) then local playerstats = getPedStat (source) setAccountData (playeraccount, "save-stats", playerstats) -- save it in his account end end function onPlayerLogin (_, playeraccount ) local playerAccount = getPlayerAccount(source) if (playeraccount) then local stats = getAccountData (playerAccount, "save-stats" ) if (stats) then setPedStat(source, stats ) end end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) pls help me
-
bad argument @ 'getaccountdata' expected account at argumen 1 got nill bad argument @ 'getPlayerAccount' expected element at argumen 1 got nill code : function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playerstats = getPedStat ( localPlayer ) setAccountData ( playeraccount, "save-stats", playerstats ) -- save it in his account end end function onPlayerLogin (_, playeraccount ) local playerAccount = getPlayerAccount(localPlayer) if ( playeraccount ) then local stats = getAccountData ( account, "save-stats" ) if ( stats ) then setPedStat ( localPlayer, stats ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
-
It's Sloved Bro But Thanks You
-
server-side : if not getElementData(plr, "isOnGround") then exports.SAEGMessages:sendClientMessage("Ironminer: You're not on the ground!", plr, 255, 0, 0) return end Client-Side: local is_on_ground,old_check = false,true function is_player_on_the_ground( ) local px, py, pz = getElementPosition(localPlayer) --outputConsole(getGroundPosition(px, py, pz + 10).." "..pz.." "..(getGroundPosition(px, py, pz + 10) + 2)) if getGroundPosition(px, py, pz + 10) < pz and (getGroundPosition(px, py, pz + 10) + 2) > pz then is_on_ground = true else is_on_ground = false end if is_on_ground ~= old_check then setElementData(localPlayer, "isOnGround", is_on_ground) old_check = is_on_ground end end is_player_on_the_ground() setTimer(is_player_on_the_ground, 500, 0) that shit not work 0 errors 0 warning i can boomb and i'm not on ground pls help
-
getplayerserial expected player at argument 1 got nill
-
function onLogin ( player, user, pass ) local s = getPlayerSerial ( source ) if ( exports.SAEGBans:isSerialBanned ( s ) ) then exports.SAEGBans:loadBanScreenForPlayer ( source ) triggerClientEvent ("hideLoginWindow") end getplayerserial expected player at argument 1 got root
-
he knows my work, and I know his intentions it's not problem if he copy your idea -.-
-
You are wanting to copy my ideas? that thing ugly man Keep saying that to everyone -.- all have ideas and maybe some one think for idea like yours -.- Stop saying That To Ppl
-
Error ?? use /debugscritp 3
-
how i can make hydra + hunter can not shot ?? i want it work only for Military + SWAT Members Can Give Me Some Examples !!
-
Hey Other Problem but new script function closewindow() guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) end addEventHandler( "onClientGUIDoubleClick", GUIEditor.window[1], closewindow ) bad agumen,t @ 'addEventHandler' expected element at agument 2 got nill
-
ye i used ur code i checked it again
-
aGuiForm = nil _gui = nil _root = getRootElement() data={}; addEvent("openGView",true) function aViewGui ( player ) if ( aGuiForm == nil ) then local x, y = guiGetScreenSize() for i=0,9 do data[i] = {}; end data[0].weapon="Sniper" data[1].weapon="Taser" data[2].weapon="Pistol" data[3].weapon="MP5" data[4].weapon="Deagle" data[5].weapon="Ak-47" data[6].weapon="M4" data[7].weapon="Uzi/TEC-9" data[8].weapon="Sawn-Off" data[9].weapon="ShotGun" data[0].price=6000 data[1].price=2500 data[2].price=3000 data[3].price=3500 data[4].price=4500 data[5].price=4500 data[6].price=5000 data[7].price=5000 data[8].price=5500 data[9].price=5500 aGuiForm = guiCreateWindow ( x / 2 - 250, y / 2 - 125, 620, 250, "Skill Shop", false ) aGuiList = guiCreateGridList ( 0.02, 0.09, 0.82, 0.86, true, aGuiForm ) guiGridListAddColumn( aGuiList, "Weapon", 0.50 ) guiGridListAddColumn( aGuiList, "Ammount", 0.80 ) aGuiBuy = guiCreateButton ( 0.86, 0.65, 0.12, 0.09, "Buy", true, aGuiForm ) aGuiClose = guiCreateButton ( 0.86, 0.85, 0.12, 0.09, "Close", true, aGuiForm ) addEventHandler ( "onClientGUIClick", aGuiForm, aClientGuiClick ) aMakeList() end guiSetVisible ( aGuiForm, true ) guiBringToFront ( aGuiForm ) showCursor(true) end addEventHandler ("openGView", _root, aViewGui) function aViewGuiClose ( destroy ) if ( ( destroy ) ) then if ( aGuiForm ) then removeEventHandler ( "onClientGUIClick", aGuiForm, aClientGuiClick ) destroyElement ( aGuiForm ) aGuiForm = nil end else guiSetVisible ( aGuiForm, false ) end end function aClientGuiClick ( button ) if ( button == "left" ) then if ( source == aGuiClose ) then aViewGuiClose ( false ) showCursor(false) elseif ( source == aGuiBuy ) then aViewGuiClose ( false ) showCursor(false) end end end function aMakeList () guiGridListClear(aGuiList) for i,v in pairs(data) do local row = guiGridListAddRow ( aGuiList ) guiGridListSetItemText ( aGuiList, row, 1 , tostring(data[i].weapon) , false, false ) guiGridListSetItemText ( aGuiList, row, 2 , tostring(data[i].price) , false, false ) end end addEventHandler('onClientGUIClick',root, function ( ) if ( source == aGuiBuy ) then if ( guiGridListGetSelectedItem ( aGuiList ) ~= -1 ) then local id,price = guiGridListGetItemText(aGuiList,guiGridListGetSelectedItem(aGuiList),1),guiGridListGetItemText(aGuiList,guiGridListGetSelectedItem(aGuiList),2) triggerServerEvent('onBuyWeapon',localPlayer,id,price) end end end )
-
[/lua]aGuiForm = nil _gui = nil _root = getRootElement() data={}; addEvent("openGView",true) function aViewGui ( player ) if ( aGuiForm == nil ) then local x, y = guiGetScreenSize() for i=0,9 do data = {}; end data[0].weapon="Sniper" data[1].weapon="Taser" data[2].weapon="Pistol" data[3].weapon="MP5" data[4].weapon="Deagle" data[5].weapon="Ak-47" data[6].weapon="M4" data[7].weapon="Uzi/TEC-9" data[8].weapon="Sawn-Off" data[9].weapon="ShotGun" data[0].price=6000 data[1].price=2500 data[2].price=3000 data[3].price=3500 data[4].price=4500 data[5].price=4500 data[6].price=5000 data[7].price=5000 data[8].price=5500 data[9].price=5500 aGuiForm = guiCreateWindow ( x / 2 - 250, y / 2 - 125, 620, 250, "Skill Shop", false ) aGuiList = guiCreateGridList ( 0.02, 0.09, 0.82, 0.86, true, aGuiForm ) guiGridListAddColumn( aGuiList, "Weapon", 0.50 ) guiGridListAddColumn( aGuiList, "Ammount", 0.80 ) aGuiBuy = guiCreateButton ( 0.86, 0.65, 0.12, 0.09, "Buy", true, aGuiForm ) aGuiClose = guiCreateButton ( 0.86, 0.85, 0.12, 0.09, "Close", true, aGuiForm ) addEventHandler ( "onClientGUIClick", aGuiForm, aClientGuiClick ) aMakeList() end guiSetVisible ( aGuiForm, true ) guiBringToFront ( aGuiForm ) showCursor(true) end addEventHandler ("openGView", _root, aViewGui) function aViewGuiClose ( destroy ) if ( ( destroy ) ) then if ( aGuiForm ) then removeEventHandler ( "onClientGUIClick", aGuiForm, aClientGuiClick ) destroyElement ( aGuiForm ) aGuiForm = nil end else guiSetVisible ( aGuiForm, false ) end end function aClientGuiClick ( button ) if ( button == "left" ) then if ( source == aGuiClose ) then aViewGuiClose ( false ) showCursor(false) elseif ( source == aGuiBuy ) then aViewGuiClose ( false ) showCursor(false) end end end function aMakeList () guiGridListClear(aGuiList) for i,v in pairs(data) do local row = guiGridListAddRow ( aGuiList ) guiGridListSetItemText ( aGuiList, row, 1 , tostring(data.weapon) , false, false ) guiGridListSetItemText ( aGuiList, row, 2 , tostring(data.price) , false, false ) end end addEventHandler('onClientGUIClick',root, function ( ) if ( source == aGuiBuy ) then if ( guiGridListGetSelectedItem ( aGuiList ) ~= -1 ) then local id,price = guiGridListGetItemText(aGuiList,guiGridListGetSelectedItem(aGuiList),1),guiGridListGetItemText(aGuiList,guiGridListGetSelectedItem(aGuiList),2) triggerServerEvent('onBuyWeapon',localPlayer,id,price) end end end )[/lua ]
-
not work 0 warinings 0 errors
-
addEvent('onBuyWeapon',true) addEventHandler('onBuyWeapon',root, function ( id , price ) if ( tonumber ( price ) and getWeaponIDFromName ( id ) ) then if ( getPlayerMoney ( client ) >= tonumber ( price ) ) then takePlayerMoney ( client , tonumber ( price ) ) setPedStat(thePlayer, 23, 999) end end end ) bad argument setpestat expected element at agument 1 got nill
