βurak
Members-
Posts
376 -
Joined
-
Last visited
-
Days Won
22
Everything posted by βurak
-
Can you show me where this function is used. are you using dx as hud? i would like to see them if possible
-
triggerServerEvent("verGasolina", localPlayer) can you change root to localPlayer
-
function checkGas() veh = getPedOccupiedVehicle(source) --here x,y,z = getElementPosition(veh) if (veh) then local plate = getVehiclePlateText(veh) local consulta = exports.mysql:_Query("SELECT * FROM vehicles WHERE plate=?", plate) if (consulta) then if (#consulta>0) then for _,column in ipairs(consulta) do ownerGet = tostring(column["owner"]) keyOW = tostring(column["keyOW"]) break end end end can you change the player to source
-
I think the player argument is invalid here, can you show me how to call this function?
-
where exactly is the error occurring? can you show the rest of the code?
-
open the txd of the weapon you want to change and do it from there, then change it using "engineLoadTXD" and "engineImportTXD"
-
client: function snbl(posx, posy, posz) local bloqueo = playSound3D("blq.mp3", posx, posy, posz, false) setSoundMaxDistance(bloqueo, 20) end addEvent("playBLQ", true) addEventHandler("playBLQ", root, snbl) server: local posX, posY, posZ = getElementPosition(thePlayer) triggerClientEvent(root, "playBLQ", thePlayer, posX, posY, posZ) Can you pass the getElementPosition to the server side, and pass the x, y, z coordinates to the event as a parameter to the client side
-
can you try this triggerClientEvent (root, "playBLQ" , root) you can also set the throttled option to false it can lower the volume playSound3D ( string soundURL, float x, float y, float z, [ bool looped = false, bool throttled = true ] )
-
change root to thePlayer this argument asks which person to send it. root means everyone triggerClientEvent(thePlayer, "playBLQ", thePlayer)
-
try using it like this function vhDam(loss) local playersLossHP = getVehicleOccupants(source) -- getVehicleOccupants returns a table for seat, player in pairs(playersLossHP) do --put this table in for loop local playerHealth = getElementHealth(player) --get the hp of the player inside the vehicle outputDebugString("Seat ID: "..seat.." Player Health: "..playerHealth) --print seat id and player's health end end addEventHandler("onVehicleDamage", root, vhDam)
-
unfortunately you can't do this by default but you can run it on server side with "triggerServerEvent" and then pass the return value back to client side with "triggerClientEvent"
-
here the function names and variable names are wrong house room See The Cars setTimer name is wrong set Timer --wrong setTimer --correct maybe you can show the rest of the code so we can help you
-
maybe you can do it like this to accept the animation of others entering the car function blockExit(exitingPed, seat, jacked, door) if(isVehicleLocked(source)) then if(not jacked) then --cancel if car is not jacked cancelEvent() end end end addEventHandler("onVehicleStartExit", getRootElement(), blockExit)
-
Can you try using the ignoredElement parameter processLineOfSight(px, py, pz, tx, ty, tz, true, true, true, true, true, false, false, false, localPlayer)
-
I'm not sure but you can try this if(elementHit ~= localPlayer) then end
-
use these functions attachElements -- to add an object to the player processLineOfSight -- to detect the object the player is standing on addCommandHandler --for the glue command
-
there may be custom animations or they may have installed extra script to provide it. because setPedAnimation always allows 1 animation and the player stays frozen (except for walking animations) you can use 3ds max to create custom animations and use "engineLoadIFP" function to load this custom animation. if you're going this way
-
I tested your idea, I guess it doesn't seem possible at the moment
-
not sure but here mta function name is used try changing it function spawnPlayer(player) -- <-- mta spawn function if not (player == nil) then local pdata = savePlayerToData(player) local x,y,z = unpack(pdata["lastposition"]) spawnPlayer(player,x,y,z,0,pdata["skin"],0,0) fadeCamera(player, true) setCameraTarget(player, player) end end
-
you can limit it by using root and using if command actually so you can handle it in a single eventhandler The nil error could possibly be because mark1 has not been created yet example: function markerHandler(hitElement, matchingDimension) if(getElementType(hitElement) == "player") then if(source == mark1) then --codes here for mark1 end if(source == mark2) then --codes here for mark2 end end end addEventHandler("onClientMarkerHit", root, markerHandler)
-
it seems you haven't started the "bone_attach" script
-
json returns a string type, so when saving, we should do it as VARCHAR in mysql, I'm not sure, but this string may be equivalent to mysql example: addCommandHandler("weap", function(player) local weapon = '[{ "27": 1500, "22": 1500, "28": 1500 } ]' --As you can see here json data is string giveWeaponsFromJSON(player, weapon) end) You can check the return value of the functions you use to distinguish it from the wiki, for example, the getPlayerName function returns a string on success. --here string getPlayerName ( player thePlayer ) likewise the setPlayerName function takes a string of data --here bool setPlayerName ( player thePlayer, string newName ) so the player's name is always string By looking at the return values of the functions you use, you can understand what should be INT and what should be VARCHAR.
- 7 replies
-
- 1
-
-
- mysql
- phpmyadmin
-
(and 3 more)
Tagged with:
-
Try using the giveWeaponsFromJSON function inside the "onPlayerSpawn" event other than that make sure the column type is VARCHAR and has sufficient length To test whether the weapon gives or not, you can enter the column manually [{ "27": 1500, "22": 1500, "28": 1500 } ] Apart from that, I tested both functions on my own computer, there is no problem.
- 7 replies
-
- 1
-
-
- mysql
- phpmyadmin
-
(and 3 more)
Tagged with:
-
I couldn't see an error here. Is the weapon column empty when you exit? Is there any error in the debugscript? You give the weapons when the player spawns, right? or maybe there is a error elsewhere
- 7 replies
-
- 1
-
-
- mysql
- phpmyadmin
-
(and 3 more)
Tagged with:
-
If you don't give a slot to getPedWeapon, it will return the weapon you have. so specify the slot you will get getPedWeapon ( ped thePed, [ int weaponSlot = current ] ) you can use JSON to save the weapons in a mysql column You can create an inventory column in mysql and then you can use convertWeaponsToJSON at game exit. When you spawned, you can give weapons using giveWeaponsFromJSON --this part will be executed when the player exits the game function convertWeaponsToJSON(player) local weaponSlots = 12 --up to which slot the weapons will be saved local weaponsTable = {} --a table to temporarily store weapons for slot=0, weaponSlots do local weapon = getPedWeapon(player, slot) local ammo = getPedTotalAmmo(player, slot) if (weapon > 0 and ammo > 0) then if(weapon == 37) then --for ammo increase bug in this flamethrower ammo = ammo/10 end weaponsTable[weapon] = ammo --create a reference to the table with the weapon id and ammo amount end end return toJSON(weaponsTable) --return table as json end --to give weapons from mysql table when this player spawn (just one time) function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then takeAllWeapons(player) --take all weapons before the player. To avoid the ammo increase bug for weapon, ammo in pairs(fromJSON(weapons)) do --convert json format to table and load weapons into player if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) --give weapon to player end end end end
- 7 replies
-
- 1
-
-
- mysql
- phpmyadmin
-
(and 3 more)
Tagged with:
