-
Posts
1,546 -
Joined
-
Last visited
Everything posted by Dimos7
-
You need attach it to player hand attachElements getKeyState fireWeapon setWeaponState setPedAimTarget
-
function test() local x, y, z = getElementPosition(localPlayer) local weapon = createWeapon("ak-47", x, y, z) setWeaponAmmo(weapon, 120) setWeaponClipAmmo(weapon, 32) setWeaponState(weapon, "firing") setElementAlpha(weapon, 0) local newAK = createObject(2965, x, y, z) attachElements(weapon, newAK) end addCommandHandler("aktest", test)
-
local result, num_affected_row= dbPoll(dbQuery(mysql, "SELECT matrica FROM vehicle WHERE id=?", vehicle:getData("veh:id")), - 1) if(num_affected_row >= 1) then dbExec(mysql, "UPDATE vehicle SET paintjob = ? WHERE id = ?", paintjob, vehicle:getData("veh:id")) else outputChatBox ( "Előbb szedd le a matricát!" ) end
-
local result = dbPoll(dbQuery(mysql, "SELECT matrica FROM vehicle WHERE id=?", vehicle:getData("veh:id")), - 1) if(#result >= 1) then dbExec(mysql, "UPDATE vehicle SET paintjob = ? WHERE id = ?", paintjob, vehicle:getData("veh:id")) else outputChatBox ( "Előbb szedd le a matricát!" ) end
-
function steeringwheel() local theVeh = getPedOccupiedVehicle(localPlayer) if getVehicleComponentRotation == handlingGetSteeringLock then local rotX, rotY, rotZ = getVehicleComponentRotation (theVeh, "steer" ) setVehicleComponentRotation(theVeh,'steer',rotX,rotY,rotX*10) end end addEventHandler("onClientRender", root, steeringwheel)
-
local result = dbPoll(dbQuery(mysql, "SELECT matrica FROM vehicle WHERE id=?", vehicle:getData("veh:id")), - 1) if(#result == 1) then dbExec(mysql, "UPDATE vehicle SET paintjob = ? WHERE id = ?", paintjob, vehicle:getData("veh:id")) else outputChatBox ( "Előbb szedd le a matricát!" ) end
-
No start script yourself and make it out of scratch
-
Use onClientClick
-
Change thePlayer to localPlayer
-
Its client side pictures not showed CLİENT CODE function createMinigunWeapon() -- Create the weapon 1 meter above the player local x, y, z = getElementPosition(getLocalPlayer()) local weapon = createWeapon("ak-47", -2413.2534179688, -593.76226806641, 134 + 1) -- Give it some ammo and fire it setWeaponClipAmmo(weapon, 0) setWeaponState(weapon, "ready") end addCommandHandler("silah", createMinigunWeapon)
-
You can do that all you need to do is go acl everyone and do that <acl right="command.login" access="false" /> <acl right="command.register" access="false"/>
-
You can use costum login system that register account both database and mta
-
Accessing the MTA built in database from outside
Dimos7 replied to keymetaphore's topic in Scripting
you can download the db from your server and look it from squlitebrowser -
addEventHandler("onPlayerTarget", getRootElement(), function(targetEl) if exports.bcho:isCriminal(source) then if(targetEl) then if(getElementType(targetEl) == "ped") then if(not getElementData(source, "rob")) then if(getElementData(targetEl, "robLoc") ~= false) then robloc = getElementData(targetEl, "robLoc") setElementData(source, "rob", robloc) setElementData(source, "Charges", tonumber(getElementData(source, "Charges"))+1000) if getElementInterior(source) ==0 then triggerClientEvent(source, "StartRobTimer", getRootElement()) end exports.Messages:sendClientMessage("Store Robbery: Don't get arrested/killed or you will fail the robbery",source, 255, 100, 0) end end end end end end) addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), function() for k, v in ipairs(getElementsByType("player")) do setElementData(v, "rob", false) end end) Try this
-
getElementInterior 0 is world
-
You can have a global database and resource conect it but you need to expprt the function to this resource ofc that is example you need table etc for working correct function connectToDatabase() connection =dbConnect("sqlite", ":/global.db") end addEventHandler("onResourceStart", resourceRoot, connectToDatabase) function getConnection () return connection end
-
Well you use addEvent to make a costum event on server side or client side you need use addEventHandler for work and then if you want used on server side but it was added on client side triggerClientEvent if was added on server side and you want to use it you need triggerServerEvent addEvent addEventHandler triggerClientEvent triggerServerEvent
- 1 reply
-
- 1
-
- addevent
- clientandserver
-
(and 1 more)
Tagged with:
-
function createC4(thePlayer) local x, y, z = getElementPosition(thePlayer) theObject = createObject(1225, x, y, z, 0,0 0) if theObject then outputConsole("Object created successfully", thePlayer) else outputConsole("Failed to create object", thePlayer) end end addCommandHandler("createObject", createC4)