illestiraqi
Members- 
                
Posts
256 - 
                
Joined
 - 
                
Last visited
 
Everything posted by illestiraqi
- 
	So can anyone help me with Server side code?
 - 
	I want the player job part to be changed to player team, please help change. Server: local vehicle = {} function isVehicleSpawned(vehicle) return getElementData(vehicle, "jobvehicle") end function doesPlayerHaveVehicleSpawned(player) if (isElement(vehicle[player])) then return true else return false end end function destroyVehicle(vehicle, player) if (isElement(vehicle[player])) then destroyElement(vehicle[player]) end end function createTheJobVehicles() for index, table in ipairs(vehicles) do marker = createMarker(table.x, table.y, table.z, "cylinder", 2, table.r, table.g, table.b) setElementData(marker, "vehiclemarker-role", table.Roles) setElementData(marker, "vehiclemarker-vehicles", table.vehicles) setElementData(marker, "vehiclemarker-rotation", table.rotation) vehicle[marker] = table.Roles local position = table.x..", "..table.y..", "..table.z..", "..", "..table.rotation local color = table.vehR..", "..table.vehG..", "..table.vehB..", " setElementData(marker, "vehiclemarker-position", position) setElementData(marker, "vehiclemarker-color", color) addEventHandler("onMarkerHit", marker, onPlayerVehicleMarkerHit) end end addEventHandler("onResourceStart", resourceRoot, createTheJobVehicles) function onPlayerVehicleMarkerHit(player) local role = getElementData(source, "vehiclemarker-role") local vehicles = getElementData(source, "vehiclemarker-vehicles") local rotation = getElementData(source, "vehiclemarker-rotation") if (getElementType(player) == "player") then if (getElementData(player, dataToFindPlayersJob) == role or role == "ALL") then if (isPedInVehicle(player)) then return end local position = getElementData(source, "vehiclemarker-position") local color = getElementData(source, "vehiclemarker-color") local posX, posY, posZ, rotation = unpack(split(position, ",")) local r, g, b = unpack(split(color, ",")) triggerClientEvent(player, "jobvehicles.showVehicleGUI", root, vehicles, rotation, posX, posY, posZ, rotation, r, g, b) else outputChatBox("This marker is reserved for '"..role.."'", player, 250, 0, 0) end end end function onPlayerSpawnVehicle(vid, vx, vy, vz, rotation, r, g, b) if (isElement(vehicle[client])) then destroyElement(vehicle[client]) end vehicle[client] = createVehicle(vid, vx, vy, vz) setElementData(vehicle[client], "jobvehicle", true) warpPedIntoVehicle(client, vehicle[client]) setElementRotation(vehicle[client], 0, 0, rotation) outputDebugString(getPlayerName(client).. " has spawned a '"..getVehicleNameFromModel(vid)) outputServerLog(getPlayerName(client).. " has spawned a '"..getVehicleNameFromModel(vid).."'") if (r) then setVehicleColor(vehicle[client], r, g, b) end end addEvent("jobvehicles.onPlayerSpawnVehicle", true) addEventHandler("jobvehicles.onPlayerSpawnVehicle", root, onPlayerSpawnVehicle) function destroyPlayerVehicle() if (isElement(vehicle[source])) then destroyElement(vehicle[source]) end end addEventHandler("onPlayerWasted", root, destroyPlayerVehicle) addEventHandler("onPlayerLogout", root, destroyPlayerVehicle) addEventHandler("onPlayerQuit", root, destroyPlayerVehicle) function destroyMyOwnVehicle(player) if (isElement(vehicle[player])) then outputChatBox("You have succesfully destroyed your "..getVehicleNameFromModel(getElementModel(vehicle[player])).."!", player, 0, 255, 10) destroyElement(vehicle[player]) elseif (not isElement(vehicle[player])) then outputChatBox("You currently do not have a job vehicle spawned to destroy!", player, 250, 0, 0) end end addCommandHandler("destroyv", destroyMyOwnVehicle) function destroyVehicleOnExplode() if (getElementData(source, "jobvehicle")) then destroyElement(source) end end addEventHandler("onVehicleExplode", root, destroyVehicleOnExplode) function onAdminDestroyJobVehicle(admin, cmd, target) local accountname = getAccountName(getPlayerAccount(admin)) if (hasObjectPermissionTo("user."..accountname, "function.kickPlayer") and target) then local player = getPlayerFromName(target) if (isElement(vehicle[player]) and player) then outputChatBox("You have destroyed "..getPlayerName(player).."' s "..getVehicleNameFromModel(getElementModel(vehicle[player])).." (jobvehicle)", admin, 0, 255, 10) outputChatBox(getPlayerName(admin).." has destroyed your "..getVehicleNameFromModel(getElementModel(vehicle[player])).." (jobvehicle)", player, 255, 10, 0) destroyElement(vehicle[player]) elseif (not isElement(vehicle[player]) and player) then outputChatBox(getPlayerName(player).. " does not currently have any job vehicle spawned.", admin, 255, 10, 0) else outputChatBox("The player do not exist!", admin, 250, 0, 0) end end end addCommandHandler("dv", onAdminDestroyJobVehicle) Client: local screenWidth, screenHeight = guiGetScreenSize() local v_table = {} function createVehicleChooserGUI() if (isElement(wndVehicle)) then if (guiGetVisible(wndVehicle)) then return end end windowWidth, windowHeight = 321, 338 windowX, windowY = (screenWidth / 2) - (windowWidth / 2), (screenHeight / 2) - (windowHeight / 2) wndVehicle = guiCreateWindow(windowX, windowY, windowWidth, windowHeight, "Select Vehicle",false) guiSetAlpha(wndVehicle, 1) gridVehicle = guiCreateGridList(9,23,303,249,false,wndVehicle) vehicleColumn = guiGridListAddColumn(gridVehicle,"Vehicle",0.-- s8) --> vehicleSpawn = guiCreateButton(9,282,96,37,"Select",false,wndVehicle) vehicleClose = guiCreateButton(216,282,96,37,"Exit",false,wndVehicle) addEventHandler("onClientGUIClick", vehicleSpawn, onPlayerSelectVehicle) addEventHandler("onClientGUIClick", vehicleClose, onPlayerExitVehicleGUI) end function showVehicleGUI(vehicles, rotation, posX, posY, posZ, rotation, r, g, b) createVehicleChooserGUI() v_table[1] = posX v_table[2] = posY v_table[3] = posZ v_table[4] = rotation v_table[5] = r v_table[6] = g v_table[7] = b showCursor(true) guiGridListClear(gridVehicle) for index, vehicles in ipairs(vehicles) do vehicleRow = guiGridListAddRow(gridVehicle) guiGridListSetItemText(gridVehicle, vehicleRow, vehicleColumn, getVehicleNameFromModel(vehicles), false, true) end end addEvent("jobvehicles.showVehicleGUI", true) addEventHandler("jobvehicles.showVehicleGUI", root, showVehicleGUI) function onPlayerExitVehicleGUI(button, state) if (button ~= "left" or state ~= "up") then return end guiSetVisible(wndVehicle, false) showCursor(false) end function onPlayerSelectVehicle(button, state) if (button ~= "left" or state ~= "up") then return end if (guiGridListGetSelectedItem(gridVehicle) == -1) then return end local vrow = guiGridListGetSelectedItem(gridVehicle) local vname = guiGridListGetItemText(gridVehicle, vrow, vehicleColumn) local vid = getVehicleModelFromName(vname) guiSetVisible(wndVehicle, false) showCursor(false) triggerServerEvent("jobvehicles.onPlayerSpawnVehicle", root, vid, v_table[1], v_table[2], v_table[3], v_table[4], v_table[5], v_table[6], v_table[7]) end Configuration: ------------------------------------------------------------------------------------ -- PROJECT: N/A -- DEVELOPERS: Sebbe -- RIGHTS: All rights reserved by developers ------------------------------------------------------------------------------------ dataToFindPlayersJob = "Occupation" vehicles = { {Roles = "Example", vehicles = {1337, 1338}, x = 1337, y = -1337, z = 36.5, rotation = 25, r = 250, g = 250, b = 250, vehR = 0, vehG = 0, vehB = 0}, }
 - 
	In this script the vehicles dont spawn, all it does is show names of vehicles and just shows there in a gui please help I'm not sure if this is Client or Server side I tried client. markers = { createMarker ( 308, 1813, 17, 'cylinder', 1.5, 255, 0, 0, 255 ), createMarker ( 318, 1813, 17, 'cylinder', 1.5, 255, 0, 0, 255 ) } local vehicles = { "Patriot", "Sanchez", "Barracks", "Hydraa", "Hunter" } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, marker in ipairs ( markers ) do addEventHandler ( "onClientMarkerHit", marker, onMarkerHit ) addEventHandler ( "onClientMarkerLeave", marker, onMarkerLeave ) end end ) function createVehGui ( ) MainGui = guiCreateWindow(408,203,240,349,"Spawn bike",false) guiWindowSetSizable ( MainGui, false ) VehGrid = guiCreateGridList(14,32,180,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Bikes",0.85) Spawn = guiCreateButton(15,305,96,35,"Spawn",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Cancel",false,MainGui) guiSetFont(Cancel,"clear-normal") for index, vehicle in ipairs(vehicles) do local row = guiGridListAddRow (VehGrid) guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false ) end end function onMarkerHit ( hitElement ) if ( hitElement == localPlayer ) then createVehGui ( hitElement ) if ( MainGui ~= nil ) then guiSetVisible ( MainGui, true ) showCursor ( true ) guiSetInputEnabled ( true ) setElementFrozen ( hitElement, true ) end end end addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == Spawn ) then local row,col = guiGridListGetSelectedItem ( VehGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName == "Patriot" then triggerServerEvent("spawnPatriot",localPlayer,vehicleName) elseif vehicleName == "Sanchez" then triggerServerEvent("spawnSanchez",localPlayer,vehicleName) elseif vehicleName == "Barracks" then triggerServerEvent("spawnBarracks",localPlayer, vehicleName) elseif vehicleName == "Hydraa" then triggerServerEvent("spawnHydraa",localPlayer, vehicleName) elseif vehicleName == "Hunter" then triggerServerEvent("spawnHunter",localPlayer, vehicleName) end else outputChatBox("Error: Please, select a vehicle of list.",255,0,0) end elseif (source == Cancel) then triggerEvent("closeWindow", localPlayer ) end end ) addEventHandler("onClientGUIDoubleClick", root, function () if ( source == VehGrid ) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, vehicleName) if vehicleName == "Patriot" then triggerServerEvent("spawnPatriot",localPlayer,vehicleName) elseif vehicleName == "Sanchez" then triggerServerEvent("spawnSanchez",localPlayer, vehicleName) elseif vehicleName == "Barracks" then triggerServerEvent("spawnBarracks",localPlayer, vehicleName) elseif vehicleName == "Hydraa" then triggerServerEvent("spawnHydraa",localPlayer, vehicleName) elseif vehicleName == "Hunter" then triggerServerEvent("spawnHunter",localPlayer, vehicleName) end end end end ) function onMarkerLeave ( leaveElement ) if ( leaveElement == localPlayer ) then triggerEvent("closeWindow", localPlayer ) end end addEvent ( "closeWindow", true ) addEventHandler ( "closeWindow", root, function ( ) guiSetVisible ( MainGui, false ) showCursor ( false ) guiSetInputEnabled ( false ) setElementFrozen ( localPlayer, false ) end )
 - 
	Please make script I tried them and is failing.
 - 
	Can anyone please give me script to remove these 2 gates, left and right gate plz I want to replace them with my gate script there please someone give me script
 - 
	For my FBI job it runs through ACL and everytime I add acl group in here it disapears Im not sure if i put it between right spot please help where do I put FBI acl team? "Everyone"> "Default"> "user.*"> "resource.*"> "Moderator"> "Moderator"> "resource.mapcycler"> "resource.mapmanager"> "resource.resourcemanager"> "resource.votemanager"> "SuperModerator"> "Moderator"> "SuperModerator"> "Admin"> "Moderator"> "SuperModerator"> "Admin"> "RPC"> "resource.admin"> "resource.webadmin"> "user.George"> "user.Nicholas"> "user.Jack">
 - 
	I want this script changed to every 10 minutes every vehicle re-respawns as usual but every 10 minutes. Instead of command I want it every 10 minutes please help me change it. Client: function triggerRespawn() triggerServerEvent ( "respawn", getLocalPlayer() ) end addCommandHandler("vhrespawn",triggerRespawn) Server: -------------------------------------------------------------------- --* Command vh respawn system *------------------------------------- --* main_s.lua *---------------------------------------------------- --* Made by kimmis *------------------------------------------------ --* Do not fuckin remove this box *--------------------------------- -------------------------------------------------------------------- function respawn() local accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then outputChatBox("***Respawning ALL Empty Vehicles In 10 Secs, get to your car to keep it***") setTimer(function () local vehicles = getElementsByType ( "vehicle" ) for k, vehicle in ipairs ( vehicles ) do if checkEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) respawnVehicle ( vehicle ) end end end, 10000, 1) end end addEvent( "respawn", true ) addEventHandler( "respawn", getRootElement(), respawn ) function checkEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
 - 
	Its the opposite. I added the copcarla.txd/dff and in game it doesent show and where I run the server it says something about not able to replace.
 - 
	My infernus mod file I want to add it to my race addons it is possible? Please help me. The .rar file name is race_infernusmod and replaces the infernus carmod please help. Do I change meta and add something please tell me.
 - 
	Anyone please help I need!
 - 
	I need this infernus mod if anyone have please post download I need this for my race server!
 - 
	There is a problem. I tested it and gate isn't moving, even before with skin it wasn't moving someone please help!
 - 
	Can somebody please remove the skins thing. I just want the gates to open if users in the FabulousBloodzGang please help. gate1= createObject ( 969, -488.75805664063, -562.94116210938, 24.461265563965, 0, 0, 180 ) gate2 = createObject ( 969, -488.5793762207, -562.96948242188, 24.451913833618, 0, 0, 0 ) gatecol = createColCircle ( -488.6, -562.94116210938, 24.461265563965, 7 ) function opengates(thePlayer) if ( getTeamName(getPlayerTeam(thePlayer)) == "FabulousBloodzGang" ) then moveObject (gate1, 5000, -495, -562.94116210938, 24.461265563965 ) moveObject (gate2, 5000, -481, -562.96948242188, 24.451913833618 ) end end skins = { [ 46 ] = true, [ 47 ] = true, [ 48 ] = true, [ 59 ] = true, [ 66 ] = true, [ 71 ] = true, [ 113 ] = true, [ 120 ] = true, [ 124 ] = true, [ 147 ] = true, [ 163 ] = true, [ 164 ] = true, [ 171 ] = true, [ 172 ] = true, [ 211 ] = true, [ 217 ] = true, [ 240 ] = true, [ 249 ] = true, } addEventHandler( "onColShapeHit", gatecol, opengates ) function closegates(thePlayer) if ( getTeamName(getPlayerTeam(thePlayer)) == "FabulousBloodzGang" ) then moveObject (gate1, 5000, -488.75805664063, -562.94116210938, 24.461265563965 ) moveObject (gate2, 5000, -488.5793762207, -562.96948242188, 24.451913833618 ) end end addEventHandler( "onColShapeLeave", gatecol, closegates )
 - 
	
[REL] ModLoader 1.0 - Loads any mod without scripting!
illestiraqi replied to Deltanic's topic in Resources
Why can't I upload copcar mods using this? - 
	For this ModLoader Resource https://community.multitheftauto.com/index.php?p= ... ls&id=3016 when ever I want to put copcarla.txd/dff, copcarsf.txd/dff, and so on I go on the game, spawn it and its the normal one. Please help!
 - 
	No I cannot I'm stupid idk how to script!
 - 
	That's why you need to use: onElementModelChange. Can you please do that Idk how
 - 
	I tried this and fails. When I go to freeroam>skins>workers>staff girl, and boy lets me take it when im not staff... please fix addEventHandler("onPlayerLogin",root, function () if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then setElementModel(source,math.random ( 211, 217 )) end end )
 - 
	-- Server Side ( = addEventHandler("onPlayerLogin",root, function () if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then setElementModel(source,math.random ( 211, 217 )) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then setElementModel(source,math.random ( 211, 217 )) end end ) Is that correct? Am I done now?
 - 
	I see setElementModel(source,id) where the id is thats where I put the model id correct? If so how do I put 2? is it setElementModel(source,211, 217) what i just did is that correct?
 - 
	This script turns the vehicle engine off by pressing F to turn on/off. Pressing L will toggle the lights on/off. this is not made by me just a notice! Anyways I want the "F" button changed to /engine to turn vehicle on/off please help. function engineOffOn(source) if isPedInVehicle(source) then local sourceVehicle = getPedOccupiedVehicle( source ) if getVehicleEngineState ( sourceVehicle ) then setVehicleEngineState ( sourceVehicle, false ) else setVehicleEngineState ( sourceVehicle, true ) end end end function changeLightsState(source) if isPedInVehicle(source) then local sourceVehicle = getPedOccupiedVehicle( player ) if getVehicleOverrideLights ( sourceVehicle ) ~= 2 then setVehicleOverrideLights( sourceVehicle, 2 ) else setVehicleOverrideLights( sourceVehicle, 1 ) end end end addEventHandler ( "onPlayerVehicleEnter",root,function( theVehicle, driver, jackerPlayer ) -- if it's the driver who got out, and he was not jacked, if driver == 0 and not jackerPlayer then -- turn on the engine setVehicleEngineState ( theVehicle, true ) end end) addEventHandler ( "onPlayerVehicleExit",root,function( theVehicle, driver, jackerPlayer ) -- if it's the driver who got out, and he was not jacked, if driver == 0 and not jackerPlayer then -- turn off the engine setVehicleEngineState ( theVehicle, false ) setVehicleOverrideLights ( theVehicle, 1 ) end end) addEventHandler ( "onResourceStart",resourceRoot,function() if res~= getThisResource() then return end local engineKey = get("@jengine.engineKey") local lightsKey = get("@jengine.lightsKey") for _, player in ipairs(getElementsByType("player")) do bindKey (player, engineKey, "down", engineOffOn ) bindKey(player,lightsKey, "down", changeLightsState ) end end) addEventHandler("onResourceStop",resourceRoot,function(res) if res~= getThisResource() then return end for _, player in ipairs(getElementsByType("player")) do unbindKey (player, engineKey, "down", engineOffOn ) unbindKey(player,lightsKey, "down", changeLightsState ) end end) addEventHandler ( "onPlayerJoin",root,function() bindKey (source,engineKey, "down", engineOffOn) bindKey(source,lightsKey, "down", changeLightsState) end) addEventHandler ( "onPlayerQuit",root,function() unbindKey (source,engineKey, "down", engineOffOn) unbindKey(source,lightsKey, "down", changeLightsState) end)
 - 
	I'm Sorry I can't Im toooooooo horrible I can't even make 1 Script of my own! Also theres another script I need witch will be 5x harder than this one
 - 
	But what if i fail bad?
 - 
	But I don't know how to make the script.
 
