-
Posts
244 -
Joined
-
Last visited
Everything posted by Price.
-
got no idea where's the problem from, is the police chief script bugged ? or what? been trying to fix it for more than a couple of days..
-
EDIT: all are working but I still join the job again, had to replace exports with mine when I ban my self and revoke the ban and type /listlawbans it still gives my name for some reason
-
"that is currently banned from law." I don't quit get where's an Element being banned other than " banned_cops_data[bad_officer] = false" which is bad_officer, and when I use it, it doesn't even work no debugs too. in Police chief script too there is an error @ this line setElementData ( ac, "lockedFromPolice", getTickCount ( ) + 5*60*1000 ); "Bad Argument expected element at argument 1"
-
Police Job Function elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 281 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) local is_law_banned = exports.GTWpolicechief:isLawBanned(client) local is_law_team = exports.GRGPlayerFunctions:isLawTeam(client) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if is_law_team and is_law_banned then exports['GRGMessages']:sendClientMessage ( "You are banned from Law Jobs! choose another job.", client, 255, 0, 0 ) return end if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['GRGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'GRGJobs:OpenJobMenu', p, 'police' ) end end ) and Police chief script --[[ ******************************************************************************** Project owner: GTWGames Project name: GTW-RPG Developers: GTWCode Source code: [url=https://github.com/GTWCode/GTW-RPG/]https://github.com/GTWCode/GTW-RPG/[/url] Bugtracker: [url=http://forum.gtw-games.org/bug-reports/]http://forum.gtw-games.org/bug-reports/[/url] Suggestions: [url=http://forum.gtw-games.org/mta-servers-development/]http://forum.gtw-games.org/mta-servers-development/[/url] Version: Open source License: GPL v.3 or later Status: Stable release ******************************************************************************** ]]-- -- Setup data base db_pc = dbConnect("sqlite", "bans.db") -- Tables for quick access police_chiefs_data = { } banned_cops_data = { } currentCount = getTickCount () --[[ Create a database table to store bans data ]]-- addEventHandler("onResourceStart", resourceRoot, function() dbExec(db_pc, "CREATE TABLE IF NOT EXISTS bans (ID INTEGER PRIMARY KEY, account TEXT)") dbExec(db_pc, "CREATE TABLE IF NOT EXISTS police_chiefs (ID INTEGER PRIMARY KEY, account TEXT)") -- Load database into tables dbQuery(load_banned_cops, db_pc, "SELECT account FROM bans ") dbQuery(load_police_chiefs, db_pc, "SELECT account FROM police_chiefs ") end) --[[ Load banned cops ]]-- function load_banned_cops(query) local result = dbPoll( query, 0 ) if not result then return end for _,row in pairs( result ) do banned_cops_data[row["account"]] = true end end --[[ Load police chiefs ]]-- function load_police_chiefs(query) local result = dbPoll( query, 0 ) if not result then return end for _,row in pairs( result ) do police_chiefs_data[row["account"]] = true end end --[[ Administrators and moderators can give a player police chief rights ]]-- function toggle_police_chief(admin, cmd, account_to_add_or_remove) -- Get the account of the administrator or moderator using this command local accName = getAccountName(getPlayerAccount(admin)) -- Check if the command issuer has the rights if not isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin")) and not isObjectInACLGroup ("user."..accName, aclGetGroup ("Moderator")) then return end -- Check if there is an account provided if not account_to_add_or_remove then outputChatBox("Correct syntax: /addpc ", admin, 255, 0, 0) return end -- Check if the provided account exist local current_chief = getAccount(account_to_add_or_remove) if not current_chief then return end -- Check if we shall add or remove this player if cmd == "addpc" then -- Add police chief to database police_chiefs_data[account_to_add_or_remove] = true dbExec(db_pc, "INSERT INTO police_chiefs VALUES (NULL,?)", account_to_add_or_remove) outputChatBox("Player: "..getPlayerName(current_chief).." was successfully added as police chief", admin, 0, 200, 0) else -- Remove police chief from database police_chiefs_data[account_to_add_or_remove] = false dbExec(db_pc, "DELETE FROM police_chiefs WHERE account=?", account_to_add_or_remove) outputChatBox("Player: "..getPlayerName(current_chief).." was removed from police chief", admin, 255, 200, 0) end end addCommandHandler("addpc", toggle_police_chief) addCommandHandler("removepc", toggle_police_chief) --[[ Police chiefs can ban from law at unlimited time ]]-- function add_law_ban(police_chief, cmd, bad_officer) -- Check if an officer to kick was provided if not bad_officer then outputChatBox("Correct syntax: /lawban ", police_chief, 255, 0, 0) return end -- Check if the provided cop account exist local cop_to_ban = getAccount(bad_officer) local cop_to_ban_plr = getAccountPlayer(cop_to_ban) if not cop_to_ban then outputChatBox("Correct syntax: /lawban ", police_chief, 255, 0, 0) return end -- Notify the cop if online if cop_to_ban_plr then exports.GTWtopbar:dm("You have been kicked from the force by: "..getPlayerName(police_chief), cop_to_ban_plr, 255, 0, 0) -- Reset job and team if online setPlayerTeam(cop_to_ban_plr, getTeamFromName("Unemployed")) setPlayerNametagColor(cop_to_ban_plr, 255, 255, 0) setElementData(cop_to_ban_plr, "admin",false) local skinID = exports.GTWclothes:getBoughtSkin(cop_to_ban_plr) setElementModel(cop_to_ban_plr, skinID) setElementData(cop_to_ban_plr, "Occupation", "") local ac = getPlayerAccount ( cop_to_ban_plr ); if ( not isGuestAccount ( cop_to_ban_plr ) ) then setElementData ( ac, "lockedFromPolice", getTickCount ( ) + 5*60*1000 ); end end -- Notify the police chief issuing the command outputChatBox("Police: "..bad_officer.." was kicked from the police job", police_chief, 255, 100, 0) end addCommandHandler("banfromlaw", add_law_ban) addCommandHandler("lawban", add_law_ban) --[[ Police chiefs can revoke law bans ]]-- function revoke_law_ban(police_chief, cmd, bad_officer) -- Check if an officer to kick was provided if not bad_officer then outputChatBox("Correct syntax: /revokelawban ", police_chief, 255, 0, 0) return end -- Check if the provided cop account exist local cop_to_ban = getAccount(bad_officer) local cop_to_ban_plr = getAccountPlayer(cop_to_ban) if not cop_to_ban then outputChatBox("Correct syntax: /revokelawban ", police_chief, 255, 0, 0) return end -- Notify the cop if online if cop_to_ban_plr then exports.GTWtopbar:dm("You are now allowed to work as a cop again, (thanks to: "..getPlayerName(police_chief)..")", cop_to_ban_plr, 0, 255, 0) end -- Notify the police chief issuing the command outputChatBox("Police: "..bad_officer.." is now allowed to work again", police_chief, 255, 100, 0) -- Remove ban from database dbExec(db_pc, "DELETE FROM bans WHERE account=?", bad_officer) banned_cops_data[bad_officer] = false end addCommandHandler("revokebanfromlaw", revoke_law_ban) addCommandHandler("revokelawban", revoke_law_ban) --[[ List banned cops ]]-- function list_banned_cops(plr) local list = "" for k,v in pairs(banned_cops_data) do local name = nil if getAccountPlayer(getAccount(k)) then name = getPlayerName(getAccountPlayer(getAccount(k))) if name then k = k.." ("..name..")" end end list = list..k..", " end outputChatBox("Lawbans: "..list, plr, 200, 200, 200) end addCommandHandler("listlawbans", list_banned_cops) addCommandHandler("listlawban", list_banned_cops) --[[ List police chiefs ]]-- function list_police_chiefs(plr) local list = "" for k,v in pairs(police_chiefs_data) do local name = nil if getAccountPlayer(getAccount(k)) then name = getPlayerName(getAccountPlayer(getAccount(k))) if name then k = k.." ("..name..")" end end list = list..k..", " end outputChatBox("Police chiefs: "..list, plr, 200, 200, 200) end addCommandHandler("listpolicechiefs", list_police_chiefs) addCommandHandler("listpolicechief", list_police_chiefs) --[[ Exported: check if a player is a police chief ]]-- function isPoliceChief(plr) if not plr or not getPlayerAccount(plr) or not getAccountName(getPlayerAccount(plr)) then return false end return police_chiefs_data[getAccountName(getPlayerAccount(plr))] or false end --[[ Exported: check if a player is a banned from law ]]-- function isLawBanned(plr) if not plr or not getPlayerAccount(plr) or not getAccountName(getPlayerAccount(plr)) then return false end return banned_cops_data[getAccountName(getPlayerAccount(plr))] or false end its GTW so I think you know that already, uhm I could still take the job and no debugs
-
I tested this and worked fine with me function createprog () loadingprog = guiCreateProgressBar(475, 653, 330, 33, false) curprog = guiProgressBarGetProgress (loadingprog) guiProgressBarSetProgress(loadingprog,curprog) end setTimer(function() curprog = curprog+10 guiProgressBarSetProgress(loadingprog,curprog) end,1000, 10) setTimer(function() destroyElement (loadingprog) end, 10000, 1)
-
I used this local is_law_banned = exports.GTWpolicechief:isLawBanned(client) if exports.GRGPlayerFunctions:isLawTeam and is_law_banned then exports.GRGMessages:sendClientMessage( "You are banned from Law Jobs! choose another job.", client, 255, 0, 0 ) return end triggerClientEvent ( p, 'GRGJobs:OpenJobMenu', p, 'police' ) still I could take the job
-
still didn't work, returning errors.. what can I do? I tried that already function isLawBanned(plr) if not plr or not getPlayerAccount(plr) or not getAccountName(getPlayerAccount(plr)) then return false end return banned_cops_data[getAccountName(getPlayerAccount(plr))] or false end and added the export in the police job, the job works normal. I can still get the job even tho I'm banned.
-
Not quite sure about this one but I uhh really don't know what should be added after getElementInterior like I can't say killped so it doesn't interrupt the training script function createAntiDmAmmu (hitElement, attacker, attackerweapon, bodypart, loss) if ( getElementInterior(thePed) == 1 ) then end addEventHandler ("onColShapeHit", rectangle, createAntiDmAmmu) addEventHandler ( "onPlayerDamage", getRootElement(), createAntiDmAmmu )
-
I already canceled event onClientPlayerDamage , and that's the problem.. can't get ammunation shop peds getting damaged, I want them to be damaged to be able to shoot and kill them
-
I have a script that makes the Ped jobs all god modded , thing is i'm using Peds in ammunation training and ofc its god modded too, so the training won't be complete, I want to make the peds inside ammunation able to get killed, any ideas? I tried some random things but this is the most random function createAntiDmAmmu (hitElement, attacker, attackerweapon, bodypart, loss) toggleControl (hitElement, "fire", true) toggleControl (hitElement, "aim_weapon", true) end addEventHandler ("onColShapeHit", rectangle, createAntiDmAmmu) addEventHandler ( "onPlayerDamage", getRootElement(), createAntiDmAmmu )
-
so there's this part of script which I'm able to kick people from police team with.. like with time /kick and when the time is over he can take the job again but when only the time is over, I have that but which I can't do is: I can't connect this command to the police job, so when I kick someone he is still being able to get the job --[[ Police chiefs can ban from law at unlimited time ]]-- function add_law_ban(police_chief, cmd, bad_officer) -- Check if an officer to kick was provided if not bad_officer then outputChatBox("Correct syntax: /lawban ", police_chief, 255, 0, 0) return end -- Check if the provided cop account exist local cop_to_ban = getAccount(bad_officer) local cop_to_ban_plr = getAccountPlayer(cop_to_ban) if not cop_to_ban then outputChatBox("Correct syntax: /lawban ", police_chief, 255, 0, 0) return end -- Notify the cop if online if cop_to_ban_plr then exports.GTWtopbar:dm("You have been kicked from the force by: "..getPlayerName(police_chief), cop_to_ban_plr, 255, 0, 0) -- Reset job and team if online setPlayerTeam(cop_to_ban_plr, getTeamFromName("Unemployed")) setPlayerNametagColor(cop_to_ban_plr, 255, 255, 0) setElementData(cop_to_ban_plr, "admin",false) local skinID = exports.GTWclothes:getBoughtSkin(cop_to_ban_plr) setElementModel(cop_to_ban_plr, skinID) setElementData(cop_to_ban_plr, "Occupation", "") end -- Notify the police chief issuing the command outputChatBox("Police: "..bad_officer.." was kicked from the police job", police_chief, 255, 100, 0) -- Save ban to database dbExec(db_pc, "INSERT INTO bans VALUES (NULL,?)", bad_officer) banned_cops_data[bad_officer] = true end addCommandHandler("banfromlaw", add_law_ban) addCommandHandler("lawban", add_law_ban) No errors, just can't connect it . thanks in advance.
-
function toggle_police_chief(admin, cmd, account_to_add_or_remove) local accName = getAccountName(getPlayerAccount(admin)) if not isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin")) and not isObjectInACLGroup ("user."..accName, aclGetGroup ("Moderator")) then return end :59: attempt to concatenate local 'accName' (a boolean value) why is it not working, I've been trying to change it for a long time and can't get it to work, any help?
-
yes I just realized now, uhm when I set it to true its the same doesnt take longer reloading but no errors
-
I tried this but doesnt work, sawn off still reloads same as Normal function ReloadWep() for i, player in pairs(getElementsByType("player")) do local weaponSlot0 = getPedWeapon( player ) if weaponSlot0 == 26 then if reloadPedWeapon ( player ) then setWeaponProperty(26, "std", "flag_anim_reload_long", 75) end end end end addEventHandler( "onResourceStart", getRootElement(), ReloadWep) I get bad argument @ 'SetWeaponproperty' expected bool at argument 4, got number '75' again, I'm trying to make sawn off reloading time takes longer time than usual!
-
I wanted to make a sawed off gun reloading time a bit slower I tried using setWeaponClipAmmo and setWeaponProperty but neither of them working, so what to do? set a timer? if yes how?
-
pilot = createTeam("Pilot",255,255,0) marker1 = createMarker(1591.93921, 1448.08423, 9.83063,"cylinder",2,0,150,255,255) marker5 = createMarker(-1415.17041 ,-131.17546 ,13.14397,"cylinder",2,0,150,255,255) marker6 = createMarker(2006.68823, -2289.57202 ,12.54688,"cylinder",2,0,150,255,255) blip11 = createBlip(2006.68823, -2289.57202 ,13.54688,41,2) marker2 = createMarker(-1385.98352, -216.73637 ,13.14844,"cylinder",6,255,255,0,255) marker3 = createMarker(1891.00195, -2624.34082 ,13.54688,"cylinder",6,255,255,0,255) marker4 = createMarker(1604.27612 ,1266.63037 ,10.81250,"cylinder",6,255,255,0,255) setElementAlpha(marker2,0) setElementAlpha(marker3,0) setElementAlpha(marker4,0) ------------ function getJob(thePlayer) setElementAlpha(marker2,255) setPlayerTeam(thePlayer,pilot) setElementModel(thePlayer,61) setElementData(thePlayer,"job","Pilot") end addEventHandler("onMarkerHit",marker1,getJob) ---------------- function getJob2(thePlayer) marker3 = createMarker(1891.00195, -2624.34082 ,13.54688,"cylinder",6,255,255,0,255) setPlayerTeam(thePlayer,pilot) setElementModel(thePlayer,61) setElementData(thePlayer,"job","Pilot") end addEventHandler("onMarkerHit",marker5,getJob2) --------------- function getJob3(thePlayer) marker2 = createMarker(-1385.98352, -216.73637 ,13.14844,"cylinder",6,255,255,0,255) setPlayerTeam(thePlayer,pilot) setElementModel(thePlayer,61) setElementData(thePlayer,"job","Pilot") end addEventHandler("onMarkerHit",marker6,getJob3) -------- function Blip1 (thePlayer) local theVehicle = getPedOccupiedVehicle(source) if (getVehicleName(theVehicle)) == "Shamal" then if getElementData (thePlayer,"job") == "Pilot" then blip1 = createBlip(-1385.98352, -216.73637 ,13.14844,41,2) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), Blip1) function DestroyBlip1 (thePlayer) if not isPedInVehicle(thePlayer) then destroyElement(blip1) end end addEventHandler("onPlayerVehicleExit", getRootElement(), DestroyBlip1 ) ------ function giveCash(thePlayer) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if( theVehicle ) and (getVehicleType(theVehicle)=="Plane") then givePlayerMoney(thePlayer,800) exports["TopBarChat"]:sendClientMessage("You have earned $800",thePlayer, 0, 90, 90, true, -- s8) --> setElementAlpha(marker3,255) blip3 = createBlip(1891.00195, -2624.34082 ,13.54688,41,2) exports["TopBarChat"]:sendClientMessage ("Go to Los Santos International Airport",thePlayer, 0, 255, 0, true, -- s8) --> destroyElement(marker2) destroyElement(blip1) end end addEventHandler("onMarkerHit",marker2,giveCash) ------------ function secondMarker(thePlayer) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if( theVehicle ) and (getVehicleType(theVehicle)=="Plane") then givePlayerMoney(thePlayer,1000) exports["TopBarChat"]:sendClientMessage("You have earned $1000", thePlayer, 0, 90, 90, true, -- s8) --> setElementAlpha(marker4,255) blip4 = createBlip(1604.27612 ,1266.63037 ,10.81250,41,2) exports["TopBarChat"]:sendClientMessage("Go to Las Venturas Airport for your last trip", thePlayer, 0, 255, 0, true, -- s8) --> destroyElement(marker3) destroyElement(blip3) end end addEventHandler("onMarkerHit",marker3,secondMarker) --------------- function thirdMarker(thePlayer) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if( theVehicle ) and (getVehicleType(theVehicle)=="Plane") then givePlayerMoney(thePlayer,1200) exports["TopBarChat"]:sendClientMessage("You have earned $1200", thePlayer, 0, 90, 90, true, -- s8) --> exports["TopBarChat"]:sendClientMessage("You have finished pilot job! Go to the blue blip to get employed again", thePlayer, 0, 255, 0, true, -- s8) --> destroyElement(marker4) destroyElement(blip4) end end addEventHandler("onMarkerHit",marker4,thirdMarker) ------------- function cancelMission() destroyElement(marker2) destroyElement(marker3) destroyElement(marker4) end addEventHandler("onPlayerWasted", getRootElement(),cancelMission); function loseCash(thePlayer) thePlane = getPedOccupiedVehicle(thePlayer) price = 1001 - getElementHealth(thePlane) takePlayerMoney(thePlayer,price*0.1) exports["TopBarChat"]:sendClientMessage("You lost some load for hitting the jet", thePlayer, 255, 0, 0, true, -- s8) --> end addEventHandler("onVehicleDamage", getRootElement(), loseCash) function cancelMission() destroyElement(marker2) destroyElement(marker3) destroyElement(marker4) end addEventHandler("onPlayerVehicleExit", getRootElement(),cancelMission); updated it and removed client side, blip1 doesnt get destroyed and those are the following errors line 82: bad argument @ 'destroyElement' [Expected element at argument 1, got nil] line 74: bad argument @ 'getPedOccupiedVehicle' [Expected element at argument 1, got vehicle] getped occupied vehicle in all functions return with error , any help? also blip1 doesnt want to get destroyed?
-
you should try it then, anyone?
-
no errors, read what I said, It only appears me 1 blip and then doesn't get destroyed after I get in marker or the marker gets destroyed too
-
So I got a problem in this script, I want to make if player is in job "Pilot" and if he enters a shamal the blip appears only to him, I have 3 blips only 1 appears and doesnt get destroyed after player hits the marker also I'm trying to do if Player hits a marker then marker gets destroyed as the blip also, and other blip gets created with marker as I specify the location, now THERE ARE SOME ERRORS, I just want some help to do what I said above. Server Side: pilot = createTeam("Pilot",255,255,0) marker1 = createMarker(1591.93921, 1448.08423, 9.83063,"cylinder",2,0,150,255,255) marker5 = createMarker(-1415.17041 ,-131.17546 ,13.14397,"cylinder",2,0,150,255,255) marker6 = createMarker(2006.68823, -2289.57202 ,12.54688,"cylinder",2,0,150,255,255) blip11 = createBlip(2006.68823, -2289.57202 ,13.54688,41,2) marker2 = createMarker(-1385.98352, -216.73637 ,13.14844,"cylinder",6,255,255,0,255) marker3 = createMarker(1891.00195, -2624.34082 ,13.54688,"cylinder",6,255,255,0,255) marker4 = createMarker(1604.27612 ,1266.63037 ,10.81250,"cylinder",6,255,255,0,255) setElementAlpha(marker2,0) setElementAlpha(marker3,0) setElementAlpha(marker4,0) ------------ function getJob(thePlayer) setElementAlpha(marker2,255) setPlayerTeam(thePlayer,pilot) setElementModel(thePlayer,61) setElementData(thePlayer,"job","Pilot") end addEventHandler("onMarkerHit",marker1,getJob) ---------------- function getJob2(thePlayer) marker3 = createMarker(1891.00195, -2624.34082 ,13.54688,"cylinder",6,255,255,0,255) setPlayerTeam(thePlayer,pilot) setElementModel(thePlayer,61) setElementData(thePlayer,"job","Pilot") end addEventHandler("onMarkerHit",marker5,getJob2) --------------- function getJob3(thePlayer) marker2 = createMarker(-1385.98352, -216.73637 ,13.14844,"cylinder",6,255,255,0,255) setPlayerTeam(thePlayer,pilot) setElementModel(thePlayer,61) setElementData(thePlayer,"job","Pilot") end addEventHandler("onMarkerHit",marker6,getJob3) -------- function giveCash( thePlayer ) theVehicle = getPedOccupiedVehicle( thePlayer ) if( theVehicle ) and (getVehicleType(theVehicle)=="Plane") then givePlayerMoney(thePlayer,800) exports["TopBarChat"]:sendClientMessage("You have earned $800",thePlayer, 0, 90, 90, true, -- s8) --> setElementAlpha(marker3,255) blip3 = createBlip(1891.00195, -2624.34082 ,13.54688,51,2) exports["TopBarChat"]:sendClientMessage ("Go to Los Santos International Airport",thePlayer, 0, 255, 0, true, -- s8) --> destroyElement(marker2) destroyElement(blip2) end end addEventHandler("onMarkerHit",marker2,giveCash) ------------ function secondMarker(thePlayer) theVehicle = getPedOccupiedVehicle( thePlayer ) if( theVehicle ) and (getVehicleType(theVehicle)=="Plane") then givePlayerMoney(thePlayer,1000) exports["TopBarChat"]:sendClientMessage("You have earned $1000", thePlayer, 0, 90, 90, true, -- s8) --> setElementAlpha(marker4,255) blip4 = createBlip(1604.27612 ,1266.63037 ,10.81250,51,2) exports["TopBarChat"]:sendClientMessage("Go to Las Venturas Airport for your last trip", thePlayer, 0, 255, 0, true, -- s8) --> destroyElement(marker3) destroyElement(blip3) end end addEventHandler("onMarkerHit",marker3,secondMarker) --------------- function thirdMarker(thePlayer) theVehicle = getPedOccupiedVehicle( thePlayer ) if( theVehicle ) and (getVehicleType(theVehicle)=="Plane") then givePlayerMoney(thePlayer,1200) exports["TopBarChat"]:sendClientMessage("You have earned $1200", thePlayer, 0, 90, 90, true, -- s8) --> exports["TopBarChat"]:sendClientMessage("You have finished pilot job! Go to the blue blip to get employed again", thePlayer, 0, 255, 0, true, -- s8) --> destroyElement(marker4) destroyElement(blip4) end end addEventHandler("onMarkerHit",marker4,thirdMarker) ------------- function cancelMission() destroyElement(marker2) destroyElement(marker3) destroyElement(marker4) end addEventHandler("onPlayerWasted", getRootElement(),cancelMission); function loseCash(thePlayer) thePlane = getPedOccupiedVehicle(thePlayer) price = 1001 - getElementHealth(thePlane) takePlayerMoney(thePlayer,price*0.1) exports["TopBarChat"]:sendClientMessage("You lost some load for hitting the jet", thePlayer, 255, 0, 0, true, -- s8) --> end addEventHandler("onVehicleDamage", getRootElement(), loseCash) function cancelMission() destroyElement(marker2) destroyElement(marker3) destroyElement(marker4) end addEventHandler("onPlayerVehicleExit", getRootElement(),cancelMission); client function Blip1 () local theVehicle = getPedOccupiedVehicle(source) if (getVehicleName(theVehicle)) == "Shamal" then if getElementData (localPlayer,"job") == "Pilot" then blip1 = createBlip(-1385.98352, -216.73637 ,13.14844,41,2) end end end addEventHandler("onClientPlayerVehicleEnter",getRootElement(),Blip1) function DestroyBlip1 () if not isPedInVehicle(localPlayer) then destroyElement(blip1) end end addEventHandler("onClientPlayerVehicleExit", getRootElement(), DestroyBlip1 ) function cancelMission() destroyElement(blip1) end addEventHandler("onPlayerWasted", getRootElement(),cancelMission);
-
that's the client side where I got the entire errors function Blip () local x, y, z = getElementPosition(client) local blip = createBlip( x, y, z, 20 ) setElementParent( blip, client ) end addEvent("onDes", true) addEventHandler("onDes", getRootElement(), Blip) client elseif ( source == placeAPBbutton ) then --- APB if ( sel ~= -1 ) then triggerServerEvent("onDes",localPlayer,text) end
