Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. Walid

    visual damage

    @CodyL , instead of using tablea you can use this for i =1, 6 do -- your code here end
  2. it can be like this table = { something = "storing data", } or table = { ["something"] = "storing data", } For more information check my Tuto : Lua Tables
  3. @CodyL, what are you doing are you serierus. you want to create more than 100 vehicle at the same time
  4. @CodyL , He need skins and cars and you are using getElementsByType("object") ???
  5. Sorry for the late reply i'm busy, As i can see you are using ccw resource (Skid marks) , ask him if it's possible to apply the shader only for one car. already create something like that before.
  6. try this untested i'm using the phone. function getTextureNameFromID(model) if model and tonumber(model) then for k, v in ipairs(engineGetModelTextureNames(model)) do return v end end end
  7. :3 addEventHandler("onClientResourceStart", resourceRoot, function() yourGui = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(yourGui, false) close = guiCreateButton(646, 20, 26, 26, "X", false, yourGui) guiSetProperty(close, "NormalTextColour", "FFFF0000") bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, yourGui) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) guiSetVisible(yourGui,false) -- events addEventHandler("onClientGUIClick",bb,clickButtonBB,false) addEventHandler ( "onClientGUIClick", close, Bezaras,false) end ) -- add all players to your gridlist function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end -- open the Gui when the player click bb button function clickButtonBB() if not guiGetVisible (yourGui) then guiSetVisible(yourGui,true) showCursor(true) addPlayersToGridlist() else guiSetVisible(yourGui,false) showCursor(false) end end -- close the gui when the player click the close button function Bezaras() if guiGetVisible (yourGui) then guiSetVisible(yourGui, false) showCursor ( false ) end end
  8. i told you , you don't know how to use it read my first post again.
  9. I think you don't know how to use it , try to do it by yourself then post your code here.
  10. There is no function called addPlayerToList() in your code , try this function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end
  11. guiGetText: Returns a string containing the requested element's text, or false if the gui element passed to the function is invalid.
  12. Working fine: Make sure you are not wearing one of these skins : 100,101,102,103. Make sure you are trying to enter Blista Compact vehicle Id : 496. local tank = {[496]=true} local skins = { [100]=true,[101]=true,[102]=true,[103]=true } function disableEnemyTankUsage ( player, seat, jacked ) if ( tank[getElementModel(source)] ) and ( not skins[getElementModel(player)] ) then cancelEvent() outputChatBox ( "Enemy vehicle!", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), disableEnemyTankUsage )
  13. Here is all what you need , it's just an example -- Server side if isPedInVehicle(thePlayer) then local vehicle = getPedOccupiedVehicle(thePlayer) local model = getElementModel(vehicle) if model == 533 then -- Feltzer triggerClientEvent( root,"eventName", root,vehicle) end end -- Client side function handleSkidmarks(vehicle) -- apply shader here end addEvent("eventName", true) addEventHandler("eventName", root,handleSkidmarks)
  14. Walid

    SOLVED!

    local current = tonumber(getElementData(player,data)) or 0
  15. function switch (player,key) if doesPedHaveJetPack (player) then local slot = getPedWeaponSlot(player) if key == "mouse_wheel_up" then if slot == 12 then setPedWeaponSlot (player,0) else setPedWeaponSlot (player,slot+1) end elseif key == "mouse_wheel_down" then if slot == 0 then setPedWeaponSlot (player,12) else setPedWeaponSlot (player,slot-1) end end end end function bindOnStart () for i,v in pairs(getElementsByType("player")) do bindKeys(v) end end addEventHandler ( "onResourceStart", resourceRoot, bindOnStart) function bindKeyOnjoin () bindKeys(source) end addEventHandler ( "onPlayerJoin", getRootElement(),bindKeyOnjoin) function bindKeys(player) if player and isElement(player) then bindKey ( player, "mouse_wheel_up", "down", switch ) bindKey ( player, "mouse_wheel_down", "down", switch ) end end
  16. Walid

    Output problem

    All what you need is: isElementWithinColShape () if the player is inside the colshape then return end that's all.
  17. Walid

    Advice

    Just replace getRootElement() with resourceRoot.
  18. Walid

    Output problem

    local teleported = false function staffcommand (player, command) if player and isElement(player) and getElementType(player) == "player" then if (isPedInVehicle(player) then return outputChatBox("You cannot use this command inside a vehicle.", player, 255, 0, 0, true) end if teleported then return outputChatBox("You can't use this Command when you are inside the land", player, 255, 0, 0, true) end local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local accName = getAccountName(account) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin"))) then setElementPosition ( player, 3749.9094238281, -194.06666564941, 5.3276481628418 ) teleported = true else outputChatBox("Only staff can use this command.", player, 255, 0, 0) end end end end end addCommandHandler("staffland", staffcommand)
×
×
  • Create New...