Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. try to replace the file names and make sure to edit your meta.xml file.
  2. Try this addEventHandler("onClientResourceStart",resourceRoot, function () weapondff = engineLoadDFF ( ":O.dff",357) engineReplaceModel (weapondff,357) weapontxd = engineLoadTXD ( ":O.txd" ) engineImportTXD (weapontxd,357) end)
  3. Try this it should work removeWorldModel (1498,10,2495.4907,-1691.4904, 14.868646)
  4. All what you need is isObjectInACLGroup() createBlipAttachedTo() -- Events onResourceStart onPlayerLogin
  5. About loops (Performance) Code 1 : Code 2 : Code 3 : Code 4: Code 5: Conclusion: Don't use pairs() or ipairs() in critical code! Try to save the table-size somewhere and use for i=1,x do!
  6. Walid

    Save Weapon

    Why you need to use "onClientRender" event simply it can be done using this two events "onClientPlayerWeaponFire" and "onClientPlayerWeaponSwitch" . -- Example addEventHandler ( "onClientPlayerWeaponFire", localPlayer, function ( weapon ) if ( getPedTotalAmmo ( localPlayer ) == 1 ) then toggleControl ( "fire", false ) end end ) addEventHandler ( "onClientPlayerWeaponSwitch", localPlayer, function ( ) toggleControl ( "fire", true ) if ( getPedTotalAmmo ( localPlayer ) == 1 ) then toggleControl ( "fire", false ) end end )
  7. Walid

    Save Weapon

    just you need to check everytime when they use the weapon to see if the ammo is 1, if yes just disable the fire control. Note : you need to do the same thing when they switch weapons. So all what you need is onClientPlayerWeaponFire onClientPlayerWeaponSwitch getPedTotalAmmo() toggleControl()
  8. Walid

    fromJSON

    try sth like this local check = exports.DB2:pobierzWyniki("SELECT * FROM `prs_frakcje` WHERE `id` = "..getElementData(source, "fid")) if type(check) ~= "table" or #check ~= 0 or check then local rank = fromJSON(check[1]["ranks"]) -- Your code end
  9. Walid

    fromJSON

    post full code here.
  10. ofc you need to use onClientRender event to draw the zone name.
  11. Walid

    \\solved

    Try this addEventHandler("onClientPlayerDamage", localPlayer, function(attacker) if (attacker and getElementType(attacker) == "player" and attacker ~= source) then if ( getTeamName( getPlayerTeam( source ) ) == "Admin" ) then cancelEvent() end end end )
  12. 1) About the first question it's not posible , maybe you can use table inside the main table like this local table = { {..., worldtex = {"sam_camo" ,"bonyrd_skin2"}, tex = {"texture1.png","texture3.png"}} } 2) About second question both are correct. 3) The last question i just gave you an example you can fix it by yourself later.
  13. Wrong it should be like this objects = { {model = 3095, x = 0, y = 0, z = 6, rx = 90, ry = 0 , rz = 0, tex = "texture name here"}, {model = 3095, x = 10, y = 0, z = 6, rx = 90, ry = 0 , rz = 0, tex = "texture name here"} } addCommandHandler("toggle", function() for i, v in pairs (objects) do local object = createObject(v.model,v.x,v.y,v.z,v.xr,v.xy,v.xz) -- Your code here end end )
  14. Try to use sth like this function ConvertAbsoluteToRelative( X, Y ) local rX, rY = guiGetScreenSize() local x = math.floor(X*rX/1280) local y = math.floor(Y*rY/720) return x, y end
  15. You don't need to create 2 objects 2 shaders and 2 textures, simply you can use tables. Example: Objects = { {model = ,x = ,y = , z = ,rx = ,ry = , rz = ,tex = "Texture name here" }, } for i , v in pairs (Objects) do -- Your code her end
  16. Walid

    Database query

    add table executeSQLQuery("CREATE TABLE IF NOT EXISTS myTable (name TEXT, ID TINYTEXT, city TEXT)") executeSQLQuery( "INSERT INTO myTable (name,ID,city ) VALUES (?,?,?) ",getAccountName(getPlayerAccount(source)),ID,city)
  17. Walid

    Database query

    are you sure that there is a column with that name (Drakath).
  18. Try this it should work function redirectPlayer(thePlayer, commandName,targetPlayer, serverIP, serverPort) if targetPlayer and serverIP and serverPort then local target = findPlayerByName(targetPlayer) if (not isElement(target)) then outputChatBox("This player does no longer exist!", thePlayer, 255, 0, 0) return end redirectPlayer(target,serverIP,tonumber(serverPort)) else outputChatBox("something missing please try again!",thePlayer,255,0,0,true) end end addCommandHandler("rd",redirectPlayer) function findPlayerByName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
  19. you are trying to use this client side or server side.
  20. All what you need is dxCreateTexture() dxCreateShader() dxSetShaderValue() engineApplyShaderToWorldTexture()
×
×
  • Create New...