-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Could mean that the script has a syntax error.
-
You want to start the engine when press J + Space? if so, use the following functions: bindKey getKeyState getPedOccupiedVehicle setVehicleEngineState
-
Acabo de subir una actualizacion que permite ponerle vida extra a los vehiculos. https://community.multitheftauto.com/in ... ls&id=5195
-
Because the server side is loading faster than the client side, so the event handler doesn't yet exist.
-
You must use isVehicleBlown and isElementInWater. function allvehiclesaredoomed ( ) local vehicles = getElementsByType ( "vehicle" ) for _, v in ipairs ( vehicles ) do if ( isVehicleBlown ( v ) or isElementInWater ( v ) ) then destroyElement ( v ) end end end addCommandHandler ( "destroyall", allvehiclesaredoomed )
-
What do you mean? I tested that code and worked perfectly.
-
That's because you changed what I gave you. The 'if' must be like this: if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then Not: if ( clip < 1 and weapSlot == validWeaponSlots [ weapSlot ] ) then Full code: local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) addEventHandler ( "onClientRender", root, function ( ) if getControlState ( "aim_weapon" ) then local ammo = getPedTotalAmmo ( localPlayer ) local clip = getPedAmmoInClip ( localPlayer ) local weaponID = getPedWeapon ( localPlayer ) local weapName = getWeaponNameFromID ( weaponID ) local weapSlot = getPedWeaponSlot ( localPlayer ) local xBone,yBone,zBone = getPedBonePosition ( localPlayer, 8 ) local zBone = ( zBone - 0.5 ) local xSP, ySP = getScreenFromWorldPosition ( xBone, yBone, zBone ) if ( xSP and ySP ) then dxDrawText ( weapName .." ".. clip .." | ".. ammo, xSP+100,ySP, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH, "default-bold", "left", "top", false, false, false, true ) if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then dxDrawText ( "Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold", "left", "top", false, false, false, true ) end end end end )
-
If that's your full script, then you forgot to define "sW" and "sH". local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } local sW, sH = guiGetScreenSize ( ) addEventHandler ( "onClientRender", root, function ( ) if getControlState ( "aim_weapon" ) then local ammo = getPedTotalAmmo ( localPlayer ) local clip = getPedAmmoInClip ( localPlayer ) local weaponID = getPedWeapon ( localPlayer ) local weapName = getWeaponNameFromID ( weaponID ) local weapSlot = getPedWeaponSlot ( localPlayer ) local xBone,yBone,zBone = getPedBonePosition ( localPlayer, 8 ) local zBone = ( zBone - 0.5 ) local xSP, ySP = getScreenFromWorldPosition ( xBone, yBone, zBone ) if ( xSP and ySP ) then dxDrawText ( weapName .." ".. clip .." | ".. ammo, xSP+100,ySP, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH, "default-bold", "left", "top", false, false, false, true ) if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then dxDrawText ( "Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold", "left", "top", false, false, false, true ) end end end end )
-
Any errors in debugscript? try debugging the script to see what weapSlot is returning, what clip is returning, etc.
-
local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } local clip = getPedAmmoInClip ( localPlayer ) local weapSlot = getPedWeaponSlot ( localPlayer ) if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then dxDrawText("Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) end
-
Make a table with the valid weapon slots, then check if the weapon slot the player is using is in that table.
-
The admin panel has a XML file with the messages, then the script reads which one it has to send depending on the action executed.
-
Well, it's quite easy, the admin panel sends each action to the server side, which includes the admin who did the action, it doesn't output that message using that event.
-
You can disable the player from using vehicles in the settings of the resource. Admin panel > Resources tab > freeroam > Settings.
-
Si queres puedo agregarselo a mi recurso, lo unico que el daño fisico no se cancela, me refiero a los golpes, etcetera.
-
We don't give support with leaked scripts. Topic locked.
-
La unica manera de hacer esto es utilizando el evento onClientVehicleDamage, que se puede cancelar.
-
You're using "freeroam"? If so, you can disable the player from using vehicles in the settings of the resource.
-
Check in the server side if triggerClientEvent is being triggered.
-
That's not what the wiki says: I also tried setting my interior to 20, then 255 and getElementInterior returns correctly.
-
You must know the object model in order to delete it.
-
You could host it on another PC and then use team viewer to control that PC from yours.
-
Read this: https://wiki.multitheftauto.com/wiki/Resources