Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. The GUI doesn't show for anyone. Even if on the Police/SWAT/Military team
  2. Thanks, but it didn't work.
  3. okey, i read those, now i have this code, but it dosn't work. --[[ Author: xXMADEXx, with Castillo's Help File: client.lua type: client Copyright 2012 (c) xXMADEXx --]] function cancelPedDamage ( attacker ) cancelEvent() end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) police_window = guiCreateWindow(350,205,728,380,"RoG Police Window",false) guiSetVisible(police_window, false) guiSetAlpha(police_window,1) guiWindowSetSizable(police_window,false) playerList = guiCreateGridList(14,34,699,272,false,police_window) column = guiGridListAddColumn(playerList,"Name",0.2) police_closeBTN = guiCreateButton(163,325,416,36,"Close",false,police_window) bindKey("F4", "down", function ( ) name = getTeamName(getPlayerTeam(player)) if ( name == "Police" ) or ( name == "Military" ) or ( name == "FBI" ) or ( name == "Swat" ) then guiSetVisible(police_window, not guiGetVisible ( police_window )) showCursor(guiGetVisible ( police_window )) if ( guiGetVisible ( police_window ) ) then guiGridListClear ( playerList ) if ( column ) then for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( playerList ) local r, g, b = getPlayerNametagColor ( player ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) guiGridListSetItemColor ( playerList, row, column, r, g, b ) end end end end end ) -- Close Button function close() guiSetVisible(police_window, false) guiSetVisible(playerList, false) guiSetVisible(column, false) showCursor(false,false) end addEventHandler("onClientGUIClick", police_closeBTN, close)
  4. I am trying to make it so that the objects below dont fall when someone hits it. For some reason it isn't working though. Any reasons? house_barrier31 = createObject ( 997, 1574.4499511719, -1605.9000244141, 12.39999961853, 0, 0, 90 ) house_barrier32 = createObject ( 997, 1574.3994140625, -1617.5, 12.39999961853, 0, 0, 90 ) house_barrier33 = createObject ( 997, 1574.44921875, -1614.3994140625, 12.39999961853, 0, 0, 90 ) house_barrier34 = createObject ( 997, 1574.44921875, -1609, 12.39999961853, 0, 0, 90 ) DYN_ROADBARRIER_41 = createObject ( 1423, 1594.0999755859, -1632.3000488281, 13.199999809265, 0, 0, 90 ) DYN_ROADBARRIER_42 = createObject ( 1423, 1574, -1619.5999755859, 13.300000190735 ) DYN_ROADBARRIER_43 = createObject ( 1423, 1583, -1619.4000244141, 13.10000038147 ) DYN_ROADBARRIER_44 = createObject ( 1423, 1586.8000488281, -1619.5, 13.10000038147, 0, 0, 170 ) DYN_ROADBARRIER_45 = createObject ( 1423, 1590.3000488281, -1621, 13.10000038147, 0, 0, 135 ) DYN_ROADBARRIER_46 = createObject ( 1423, 1592.5999755859, -1624.1999511719, 13.10000038147, 0, 0, 110 ) DYN_ROADBARRIER_47 = createObject ( 1423, 1593.9000244141, -1628.3000488281, 13.10000038147, 0, 0, 100 ) DYN_ROADBARRIER_48 = createObject ( 1423, 1578.7998046875, -1619.599609375, 13.300000190735 ) DYN_F_IRON_11 = createObject ( 1419, 1544.5999755859, -1621.8000488281, 13.10000038147, 0, 0, 90 ) DYN_F_IRON_12 = createObject ( 1419, 1544.5999755859, -1619.8000488281, 13.10000038147, 0, 0, 90 ) DYN_F_IRON_13 = createObject ( 1419, 1544.599609375, -1634.8000488281, 13.10000038147, 0, 0, 90 ) DYN_F_IRON_14 = createObject ( 1419, 1544.599609375, -1639, 13.10000038147, 0, 0, 90 ) setElementFrozen(house_barrier31,true) setElementFrozen(house_barrier32,true) setElementFrozen(house_barrier33,true) setElementFrozen(house_barrier34,true) setElementFrozen(DYN_ROADBARRIER_41,true) setElementFrozen(DYN_ROADBARRIER_42,true) setElementFrozen(DYN_ROADBARRIER_43,true) setElementFrozen(DYN_ROADBARRIER_44,true) setElementFrozen(DYN_ROADBARRIER_45,true) setElementFrozen(DYN_ROADBARRIER_46,true) setElementFrozen(DYN_ROADBARRIER_47,true) setElementFrozen(DYN_ROADBARRIER_48,true) setElementFrozen(DYN_F_IRON_11,true) setElementFrozen(DYN_F_IRON_12,true) setElementFrozen(DYN_F_IRON_13,true) setElementFrozen(DYN_F_IRON_14,true)
  5. Oh, nevermind. Fixed that, but how do i lock the GUI to team Police?
  6. The GUI will not show. In "debugscript 3" it says: "Warning: Loading script failed. Test\client:26: unexpected symbol near ')' "
  7. How can i make it so that when someone presses "F5" the GUI becomes visible, but if the GUI is visible it will close if you press F5 again. And, when someone closes then opens the GUI again all the names are in there twice. Any way to fix that? police_window = guiCreateWindow(350,205,728,380,"RoG Police Window",false) guiSetVisible(police_window, false) guiSetAlpha(police_window,1) guiWindowSetSizable(police_window,false) playerList = guiCreateGridList(14,34,699,272,false,police_window) column = guiGridListAddColumn(playerList,"Name",0.2) police_closeBTN = guiCreateButton(163,325,416,36,"Close",false,police_window) bindKey("F5", "down", function ( ) if ( guiGetVisible ( police_window ) == false ) then showCursor(true) guiSetVisible(police_window,true) guiSetVisible(playerList, true) guiSetVisible(column, true) if ( column ) then for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( playerList ) local r, g, b = getPlayerNametagColor ( player ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) guiGridListSetItemColor ( playerList, row, column, r, g, b ) end end else if ( guiGetVisible ( police_window ) == false ) then guiSetVisible(police_window, true) guiSetVisible(playerList, true) guiSetVisible(column, true) showCursor(true) end end end ) -- Close the window function close() guiSetVisible(police_window, false) guiSetVisible(playerList, false) guiSetVisible(column, false) showCursor(false,false) end addEventHandler("onClientGUIClick", police_closeBTN, close)
  8. I looked at onClientPlayerWeaponFire a little more, and now my client side looks like this: function targetingActivated ( target ) local name = getTeamName(getPlayerTeam(source)) local nick=getPlayerName(source) if ( name == "Police" ) or ( name == "Swat" ) or ( name == "FBI" ) or ( name == "Military" ) then if ( target ) then local weapon = getPedWeapon ( source ) if weapon == 23 and getElementType(target)=="player" then triggerServerEvent ( "shot", target) end end end end addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), targetingActivated )
  9. --c function targetingActivated ( target ) local name = getTeamName(getPlayerTeam(source)) local nick=getPlayerName(source) if ( name == "Police" ) or ( name == "Swat" ) or ( name == "FBI" ) or ( name == "Military" ) then if ( target ) then local weapon = getPedWeapon ( source ) if weapon == 23 then if getElementType(target) == "player" then triggerServerEvent ( "shot", target) outputChatBox("You have tazed ".. target, source, 255, 0, 0 ) end end end end end addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), targetingActivated ) -- S local time = 1 function Praliz() setElementFrozen ( source, true ) setPedAnimation( source, "ped", "KO_shot_stom") setTimer(setElementFrozen, time*3000, 1, source, false) setTimer(setPedAnimation, time*3000, 1, source) end addEvent( "shot", true ) addEventHandler( "shot", getRootElement(),Praliz)
  10. i used onPlayerDamage, but nothing happend to the person who got shot. Any suggestions?
  11. Hey guys, i am using the community tazer. It isnt working well tho. I don't want the eventHandler to be "onClientPlayerTarget", i want to to toggle when the player gets shot. Any Help? -- S local time = 1 function Praliz() setElementFrozen ( source, true ) setPedAnimation( source, "ped", "KO_shot_stom") setTimer(setElementFrozen, time*3000, 1, source, false) setTimer(setPedAnimation, time*3000, 1, source) end addEvent( "shot", true ) addEventHandler( "shot", getRootElement(),Praliz) -- C function targetingActivated ( target ) local name = getTeamName(getPlayerTeam(source)) local nick=getPlayerName(source) if ( name == "Police" ) or ( name == "Swat" ) or ( name == "FBI" ) or ( name == "Military" ) then if ( target ) then local weapon = getPedWeapon ( source ) if weapon == 23 then if getElementType(target) == "player" then triggerServerEvent ( "shot", target) outputChatBox("You have tazed ".. target, source, 255, 0, 0 ) end end end end end addEventHandler ( "", getRootElement(), targetingActivated )
  12. I got a weird bug with this script. When someone ( with wrong skin ) enters the car, it will work fine and block them from entering the car. But if someone with correct skin enters the car, it give them net trouble. Thanks in advance miliVeh = { [520]=true, [432]=true, [433]=true, [470]=true } miliSkin = { [287]=true, [217]=true } policeVeh = { [497]=true, [596]=true, [597]=true, [599]=true, [523]=true, [598]=true } policeSkin = { [217]=true, [287]=true, [265]=true, [266]=true, [267]=true, [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true, [288]=true } fbiVeh = { [490]=true, [528]=true } fbiSkin = { [286]=true, [217]=true } swatVeh = { [601]=true, [427]=true } swatSkin = { [285]=true, [217]=true } function mili ( thePlayer, seat, jacked ) if ( miliVeh[getElementModel ( source )] ) and ( not miliSkin[getElementModel ( thePlayer )] ) then if ( seat == 0 ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "Error: You are not in the Military!", thePlayer, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), mili ) function police ( thePlayer, seat, jacked ) if ( policeVeh[getElementModel ( source )] ) and ( not policeSkin[getElementModel ( thePlayer )] ) then if ( seat == 0 ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "Error: You are not a cop!", thePlayer, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), police ) function fbi ( thePlayer, seat, jacked ) if ( fbiVeh[getElementModel ( source )] ) and ( not fbiSkin[getElementModel ( thePlayer )] ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "Error: You are not in the F.B.I!", thePlayer, 255, 0, 0, true ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), fbi ) function swat ( thePlayer, seat, jacked ) if ( swatVeh[getElementModel ( source )] ) and ( not swatSkin[getElementModel ( thePlayer )] ) then if ( seat == 0 ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "Error: You are not in the swat!", thePlayer, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), swat )
  13. Wow, that made me feel like a todal noob.
  14. How do i make it spawn in black? abcvehicle = createVehicle ( 506, 1516, -694, 94.75, 0, 0, 90 )
  15. Well, It does not save the ped to the xml file.
  16. /addpedfile will not work. It dosnt create the ped file, and when i insert a peds.xml (with the correct tags) it will say "Ped-System: Failed to load XML file!," How do i fix this?
  17. Yes, the place were all the ped files are is "[ROG]Core/peds/{server, client, peds.xml}
  18. @Castro That worked, but it will not load the file.
  19. How can i make it so that when someone hits a marker that the code below will show, but the marker will not do anything until they press 'H'?
  20. Ped-System: Failed to load XML file!
  21. Since still kinda new to saving stuff to XML, can you help me make it so this will work: -- Create Peds.xml and insert tags -- function createFileHandler() local peds = xmlCreateFile("peds/peds.xml","peds") local ped = xmlCreateChild(peds, "ped") xmlSaveFile(peds) end addCommandHandler("addpedfile", createFileHandler) function pedfunc (player, cmd, id) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "lvl 5" ) ) then local x, y, z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) local int = getElementInterior(player) local dim = getElementDimension(player) local load = xmlLoadFile("peds/peds.xml") local oncreateped = xmlFindChild(load, "peds", 0) created = createPed ( id, x+1, y, z, rx, int, dim ) setElementInterior(created, int) setElementDimension(created, dim) setElementRotation(created, rx,ry,rz) setElementFrozen(created, true) outputChatBox("Ped-System: You have successfully made a ped with an ID of #ff0000".. id .."#00ff00!", player, 0, 255, 0, true ) xmlNodeSetAttribute(oncreateped, "ped", "id=".. id .. " x=" .. x .. " y=".. y .." z=".. z .." rotation=".. rx .." int=".. int .." dim=".. dim) if ( id == "" ) then outputChatBox("Ped-System: Error, the command is /addped ", player, 255, 0, 0 ) end else outputChatBox("Ped-System: This command is only for admins!", player, 255, 0, 0 ) end end addCommandHandler("addped", pedfunc)
×
×
  • Create New...