Jump to content

abu5lf

Members
  • Posts

    2,193
  • Joined

  • Last visited

Everything posted by abu5lf

  1. abu5lf

    Player list

    Code does not work ^ The script works, but only if my right to search for the player repeats in Grid List
  2. abu5lf

    Player list

    function onClientGUIChanged() local name = guiGetText(source) for index, player in pairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), name:lower()) then local column = guiGridListAddColumn ( playerlist, "Player Name", 1.50 ) if ( column ) then for id, playeritem in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( playerlist ) guiGridListSetItemText ( playerlist, row, column, getPlayerName( playeritem ), false, false ) end end end end end addEventHandler("onClientGUIChanged", bhsh, onClientGUIChanged) This edit does not work correctly, so finds a player
  3. Well Well I no longer needed to help
  4. This is exactly I want
  5. I want to go with the vehicle I have a player spawn
  6. function (theVehicle) local model = getElementModel(player) if (getVehicleType(theVehicle) == "player") then spawnPlayer ( player, 1762.1877441406, 815.47033691406, 10.41355895996914, 0, model, 0, 0 ) outputChatBox("* Successfully spawn ", player, 0, 255, 0) end end I want to go with the vehicle I have a player spawn
  7. abu5lf

    Open Panel

    not work , Can you make it to a team
  8. أإركْدُو يَ زَكْرّت , مأإهنأإ مَشّكْلّةْ
  9. abu5lf

    Open Panel

    I want her all to the same group just does not matter the team
  10. abu5lf

    Open Panel

    I want to open the panel to set the police but did not work, I do not know why ? function clickmenu (mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY) -- outputChatBox ("1") local accountname = "" if (isGuestAccount(getPlayerAccount(v)) == false) then accountname = getAccountName (getPlayerAccount(v)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Police" ) ) then outputChatBox ("00") if ( buttonState == "down" ) then -- outputChatBox ("2") if ( hasObjectPermissionTo ( source, "function.kickPlayer", true ) ) then -- outputChatBox ("3") if ( getElementData ( getRootElement(), "adminclickopen" ) == false ) then -- outputChatBox ("4") if ( getElementData (getRootElement(), "adminclickmousebind") == true ) then -- outputChatBox ("5") if ( mouseButton == "right" ) then if ( clickedElement ) then if ( getElementType (clickedElement) == "player" ) then name = getPlayerName (clickedElement) setElementData (getRootElement(), "adminclickselplayer", tostring(name) ) setElementData (getRootElement(), "adminclickopen", true) triggerClientEvent (source,"playermenu", getRootElement() ) elseif ( getElementType (clickedElement) == "vehicle" ) then thecar = clickedElement setElementData ( source, "adminclickselplayer", thecar ) triggerClientEvent (source,"carmenu", getRootElement() ) --setElementVelocity ( clickedElement, 0, 0, 1.5) end end elseif ( mouseButton == "left" ) then --outputChatBox ( worldPosX .. "," .. worldPosY .. "," .. worldPosZ ) --[[ Random send cars & players flying, can be abused col = createColCircle ( worldPosX, worldPosY, 15) colelements = getElementsWithinColShape (col) for theKey,theElement in ipairs(colelements) do if ( getElementType (theElement) == "player" ) then setElementVelocity ( theElement, 2, 0, 5) elseif ( getElementType (theElement) == "vehicle" ) then setElementVelocity ( theElement, 2, 0, 1.5) end end --]] end end end end end end
  11. This script is to save the police team but does not work I tried a lot but my attempts failed is function onLogin () local uAccount = getPlayerAccount ( source ) local sTeamName = getAccountData ( uAccount, 'POLICE' ) if uAccount and not isGuestAccount ( uAccount ) and sTeamName then setPlayerTeam ( source, getTeamFromName( sTeamName ) ) setElementModel (source, 280) spawnPlayer ( source, 2292.0925292969, 2451.7045898438, 10.8203125, 0, 280, 0, 0 ) else setPlayerTeam ( source, nil ) end end addEventHandler ("onPlayerLogin", root, onLogin) function saveData () local theAccount = getPlayerAccount(source) local team = getPlayerTeam(source) local uTeam = getTeamName ( team ) if theAccount and not isGuestAccount(theAccount) and team == getTeamFromName("Police") then if uTeam then setAccountData (theAccount, "POLICE", uTeam ) end end end addEventHandler ("onPlayerQuit", root, saveData) addEventHandler ("onPlayerLogout", root, saveData)
  12. thanks you problem solved
  13. function onLogin (_,account) local police = getAccountData(account, "polic") if police then setPlayerTeam ( source, police ) setElementModel (source, 230) end end addEventHandler ("onPlayerLogin", root, onLogin) function saveData(thePlayer, theAccount) if (getPlayerTeam(thePlayer) == getTeamFromName("Police")) and (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "police", getTeamFromName("Police") ) end end addEventHandler ("onPlayerQuit", root, saveData) addEventHandler ("onPlayerLogout", root, saveData)
  14. addEvent("wep1", true) addEventHandler("wep1", l_0_0, function() if getPlayerMoney(source) >= 150 then takePlayerMoney(source, 150) giveWeapon(source, 24, 700) setPedWeaponSlot(source, getSlotFromWeapon(24)) local l_2_0 = getPlayerName(source) outputChatBox("#ffffff[#FFFF00 " .. l_2_0 .. "#ffffff]===>#ffccff Has Bought deagle #00ff00$150 #ffccff...", getRootElement(), 255, 0, 0, true) else outputChatBox("You don't have $150 to buy deagle", source, 255, 0, 0, true) end end )
  15. setElementData (getRootElement(), "adminclickopen", false) setElementData (getRootElement(), "adminclickmousebind", false) function clickmenu (mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY) if ( buttonState == "down" ) then if ( hasObjectPermissionTo ( source, "function.kickPlayer", true ) ) then if ( not getElementData ( source, "adminclickopen" ) ) then if ( getElementData ( source, "adminclickmousebind") ) then if ( mouseButton == "right" ) then if ( clickedElement ) then if ( getElementType (clickedElement) == "player" ) then name = getPlayerName (clickedElement) setElementData ( source, "adminclickselplayer", tostring(name) ) setElementData ( source, "adminclickopen", true) triggerClientEvent (source,"playermenu", getRootElement() ) elseif ( getElementType (clickedElement) == "vehicle" ) then thecar = clickedElement setElementData ( source, "adminclickselplayer", thecar ) triggerClientEvent (source,"carmenu", getRootElement() ) end end elseif ( mouseButton == "left" ) then --outputChatBox ( worldPosX .. "," .. worldPosY .. "," .. worldPosZ ) --[[ Random send cars & players flying, can be abused col = createColCircle ( worldPosX, worldPosY, 15) colelements = getElementsWithinColShape (col) for theKey,theElement in ipairs(colelements) do if ( getElementType (theElement) == "player" ) then setElementVelocity ( theElement, 2, 0, 5) elseif ( getElementType (theElement) == "vehicle" ) then setElementVelocity ( theElement, 2, 0, 1.5) end end --]] end end end end end end addEventHandler( "onPlayerClick", getRootElement(), clickmenu ) function onstart() players = getElementsByType ( "player" ) -- get a table of all the players in the server for theKey,player in ipairs(players) do if ( hasObjectPermissionTo ( player, "function.kickPlayer", true ) ) then setElementData ( player, "adminclickopen", false) setElementData ( player, "adminclickmousebind", false) bindKey (player, "o", "down", showmouse, player ) end end end addEventHandler ( "onResourceStart", getRootElement(), onstart ) function showmouse ( player ) showCursor ( player, not isCursorShowing ( player ) ) setElementData ( player, "adminclickmousebind", isCursorShowing ( player ) ) end function bindmouse () if ( hasObjectPermissionTo ( source, "function.kickPlayer", true ) ) then setElementData ( source, "adminclickopen", false ) setElementData ( source, "adminclickmousebind", false ) bindKey ( source, "o", "down", showmouse ) end end addEventHandler ("onPlayerLogin", getRootElement(), bindmouse ) addEvent ( "destroyVehicle", true ) addEventHandler ( "destroyVehicle", root, function ( theVehicle ) if ( theVehicle ) then destroyElement ( theVehicle ) setElementData ( source, "adminclickselplayer", nil ) end end ) function playermenu () if ( guiGetVisible (mainwindow) == false ) then victimemt = getElementData ( getRootElement(), "adminclickselplayer" ) mainwindow = guiCreateWindow ( 750, 250, 240, 180, "Car menu", false ) -- fixveh = guiCreateButton ( 0.05, 0.15, 0.4, 0.15, "Fix vehicle", true, mainwindow ) blowveh = guiCreateButton ( 0.55, 0.15, 0.4, 0.15, "Blow up vehicle", true, mainwindow ) -- delveh = guiCreateButton ( 0.05, 0.35, 0.4, 0.15, "Delete vehicle", true, mainwindow ) colveh = guiCreateButton ( 0.55, 0.35, 0.4, 0.15, "Colour vehicle", true, mainwindow ) -- upgveh = guiCreateButton ( 0.05, 0.55, 0.4, 0.15, "Upgrade vehicle", true, mainwindow ) selowner = guiCreateButton ( 0.55, 0.55, 0.4, 0.15, "Select driver", true, mainwindow ) -- closebutton = guiCreateButton ( 0.30, 0.8, 0.4, 0.15, "Close", true, mainwindow ) addEventHandler( "onClientGUIClick", closebutton, disable, false) addEventHandler( "onClientGUIClick", selowner, selectowner, false) addEventHandler( "onClientGUIClick", delveh, vc, false) -- addEventHandler( "onClientGUIClick", mutebutton, mute, false) -- addEventHandler( "onClientGUIClick", freezebutton, freeze, false) -- addEventHandler( "onClientGUIClick", banbutton, ban, false) -- addEventHandler( "onClientGUIClick", kickbutton, kick, false) end end addEvent ("carmenu", true) addEventHandler ("carmenu", getRootElement(), playermenu) function disable () guiSetVisible ( mainwindow, false) setElementData ( source, "adminclickselplayer", "none" ) setElementData (getRootElement(), "adminclickopen", false) end function selectowner () thecar = getElementData ( getRootElement(), "adminclickselplayer" ) occupant = getVehicleOccupant ( thecar ) guiSetVisible ( mainwindow, false) if ( occupant ) then setElementData ( getRootElement(), "adminclickselplayer", getPlayerName(occupant) ) triggerEvent ("playermenu", occupant) else outputChatBox ("This vehicle does not have a driver", 255, 0, 0 ) end end function vc ( ) local thecar = getElementData ( localPlayer, "adminclickselplayer" ) if ( thecar and isElement ( thecar ) ) then triggerServerEvent ( "destroyVehicle", localPlayer, thecar ) end end I have tried this but the player menu do not show to me !!
  16. I will try to resolve the problem Thank you for your help
  17. He worked to delete the vehicle but the window to not show selection another vehicle also actions the player not show the window
×
×
  • Create New...