Jump to content

denny199

Members
  • Posts

    877
  • Joined

  • Last visited

Everything posted by denny199

  1. so it doesn't get the target EDIT** sorry for double post
  2. ^^^^^^^^^^^^^^^^^^ i had a full target... without a target | \/
  3. hi there I'm back i changed the code a little bit but now i got a error @ getProjectileTarget;mayby should i use costum rockets? addEventHandler( "onClientProjectileCreation", root, function( creator ) car = getPedOccupiedVehicle ( player ) local target = getProjectileTarget( car ) if isElement( target ) and getElementType( target ) == 'vehicle' and isElement( creator ) and getElementType( creator ) == 'vehicle' then local attacker = getVehicleController( creator ) local player = getVehicleController( target ) if isElement( attacker ) and isElement( player ) then triggerServerEvent( 'onVehicleExploded',player,attacker ) end end end ) [ i added car and changed it getProjectileTarget to car ]
  4. will look tommorow thanks realy thanks both
  5. not working. client and server not working
  6. ok i will try it tommorow tying the hunter fight messages now. or I'm, trying it in the evning
  7. Could you help me to update the code caus i get it a little bit conffused in my head
  8. could u give me a example?
  9. well, kenix code didn't work it does nothing now i saw the updated, thanks for that but it's now serverside
  10. it says bad argument @ getpecoccupiedvehicle used this code function kill ( ammo, killer, killerweapon, bodypart ) local vehicle = getPedOccupiedVehicle( killer ) if isElement( vehicle ) and getElementModel( vehicle ) == 425 then outputChatBox ( getPlayerName( killer )..' has killed '..getPlayerName( source )..' with his hunter.' ) end end addEventHandler ( "onPlayerWasted", root, kill )
  11. ofc, If you have got a hunter fight Like this: I shoot you and you got killed by me then i will that in the chatbox comes: ( "Danny has killed Kennix with his hunter" )
  12. hi there I was wondering that some servers have liek this: a hunter fight; Danny hitted Joop with his hunter like that but how? i maded like this: but when i shoot it comes test: and a error in debugscript: ser bad argument 17: getelementtype but i wanna make if a player hits a another player with his rocket that it comes in the chatbox that he hitted him please help me -- i know from wiki but i dnunno were to start function onPlayerTarget ( targetElem ) if getElementType ( targetElem ) == "vehicle" and getElementModel ( targetElem ) == 425 then outputChatBox ( "test" ) end end addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTarget )
  13. [10:22:31] ERROR: 1mapshop\server.lua:63: attempt to call a nil value @ line 63: --server loadstring("return "..funcname)()(unpack(arg)) and with triggerServerEvent it doesn't work i added in race/meta.xml the export and in the mapshop.
  14. And can somebody tell what i need to edit? Or am i wrong that i need to change this?
  15. Please help waiting for long ;-(
  16. pffff you can make that the chatbox say names like: mapname.. had been deleted by:name But i think this is true. Somepeople are arrogant last time
  17. denny199

    [DD] GMC Maps

    Put other link mediafire blocked....
  18. Oke, i was a little time inactive but now i was trying to pass a extra argument like: onServerCallsClientFunction That Is A Extra Trigger Function but now i got a error But this error is here now: [18:11:19] ERROR: mapshop\server.lua:28: attempt to call a nil value Please help me Client: ------------------------------------------ -- Calling function from the client's side ------------------------------------------ function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction) ----------------------- -- Call server function ----------------------- function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end outputChatBox("Race Shop By Danny Loaded",255,255,0) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(701,328,584,394,"Map Shop",false) GUIEditor_Image[1] = guiCreateStaticImage(11,19,564,366,"back.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(273,13,289,21,"Local Money:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[1],0,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(270,75,284,70,"A Map Costs 4000$\n\nHow To Get Money?\nStand in the top3 of winners or reach the hunter",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Button[1] = guiCreateButton(280,264,265,91,"Buy Map [ -4000 ]",false,GUIEditor_Image[1]) GUIEditor_Label[3] = guiCreateLabel(272,36,252,19,"Local Map Status:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,0) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(286,211,252,45,"Local Map",false,GUIEditor_Image[1]) GUIEditor_Label[4] = guiCreateLabel(293,170,233,37,"Selected Map:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[4],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[4],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"center",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") mapGridList = guiCreateGridList(3,5,254,357,false,GUIEditor_Image[1]) guiGridListSetSelectionMode(mapGridList,2) mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85) guiGridListSetSelectionMode(mapGridList,2) guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Image[1], false) function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( GUIEditor_Edit[1], gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1 ) addEvent("sendMaps", true ) function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) end addEventHandler( "sendMaps", getLocalPlayer(), sendmaps ) function test () local mapName = guiGridListGetItemText ( mapGridList, guiGridListGetSelectedItem( row ), 1 ) triggerServerEvent("nm", getLocalPlayer(), mapName) end addCommandHandler ( "lol", test ) addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == GUIEditor_Button[1]) then outputChatBox("Button doet het") mapName = guiGetText ( GUIEditor_Edit[1] ) --local row,column = guiGridListGetSelectedItem(gridMaps) --local mapName = guiGridListGetItemText(gridMaps,row,1) callServerFunction("nm",getLocalPlayer(),mapName) end end) addEvent( "clearGridList", true ) function clearGridList() guiGridListClear( mapGridList ) end addEventHandler( "clearGridList", getLocalPlayer(), clearGridList ) function onresourceStart () bindKey ("F1", "down", showPanel) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showPanel () getVisible = guiGetVisible (GUIEditor_Window[1]) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Image[1], false) showCursor (false) end if (getVisible == false) then triggerServerEvent ( "dannyevent", getRootElement()) guiSetVisible (GUIEditor_Window[1], true) guiSetVisible (GUIEditor_Image[1], true) showCursor (true) local playerMoney = getPlayerMoney(source) guiSetText ( GUIEditor_Label[1], "Local Money: [ " .. playerMoney .. " ]" ) end end Server: local rootElement = getRootElement() function race(rank) ouputChatBox ( "test" ) local playername = getPlayerName(source) givePlayerMoney(source,1500) outputChatBox("*Race: "..playername.." took $1500 for finishing first!",rootElement,255,153,0) end addEventHandler("onPlayerFinish", rootElement, race ) function snm(mapName) outputChatBox("Trigger Doet het") --exports.mapmanager:changeGamemodeMap(mapName) executeCommandHandler("nextmap", source, mapName) end addEvent("nm", true) addEventHandler("nm", getRootElement(),snm) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end function mappenerin() local resourceTable = getResources() triggerClientEvent ( "clearGridList", getRootElement() ) for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) local type1 = getResourceInfo ( resourceValue, "type" ) local gamemode1 = getResourceInfo ( resourceValue, "gamemodes" ) if type1 == "map" and gamemode1 == "race" then triggerClientEvent ( "sendMaps", getRootElement(), name) else cancelEvent() end end end addEvent("dannyevent", true ) addEventHandler( "dannyevent", rootElement, mappenerin )
  19. Well, if i now pres the button without admin it doesn't set the next map
  20. That's not my problem The problem is that only admins can buy maps and non admins can't buy maps or must i change the acl?
  21. Whole code ok: client GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(701,328,584,394,"Map Shop",false) GUIEditor_Image[1] = guiCreateStaticImage(11,19,564,366,"back.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(273,13,289,21,"Local Money:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[1],0,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(270,75,284,70,"A Map Costs 4000$\n\nHow To Get Money?\nStand in the top3 of winners or reach the hunter",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Button[1] = guiCreateButton(280,264,265,91,"Buy Map [ -4000 ]",false,GUIEditor_Image[1]) GUIEditor_Label[3] = guiCreateLabel(272,36,252,19,"Local Map Status:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,0) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(286,211,252,45,"Local Map",false,GUIEditor_Image[1]) GUIEditor_Label[4] = guiCreateLabel(293,170,233,37,"Selected Map:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[4],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[4],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"center",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") mapGridList = guiCreateGridList(3,5,254,357,false,GUIEditor_Image[1]) guiGridListSetSelectionMode(mapGridList,2) mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85) guiGridListSetSelectionMode(mapGridList,2) guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Image[1], false) function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( GUIEditor_Edit[1], gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1 ) addEvent("sendMaps", true ) function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) end addEventHandler( "sendMaps", getLocalPlayer(), sendmaps ) addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == GUIEditor_Button[1]) then outputChatBox("Button doet het") mapName = guiGetText ( GUIEditor_Edit[1] ) triggerServerEvent ("nm", getLocalPlayer(), mapName) end end) addEvent( "clearGridList", true ) function clearGridList() guiGridListClear( mapGridList ) end addEventHandler( "clearGridList", getLocalPlayer(), clearGridList ) function onresourceStart () bindKey ("F1", "down", showPanel) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showPanel () getVisible = guiGetVisible (GUIEditor_Window[1]) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Image[1], false) showCursor (false) end if (getVisible == false) then triggerServerEvent ( "dannyevent", getRootElement()) guiSetVisible (GUIEditor_Window[1], true) guiSetVisible (GUIEditor_Image[1], true) showCursor (true) local playerMoney = getPlayerMoney(source) guiSetText ( GUIEditor_Label[1], "Local Money: [ " .. playerMoney .. " ]" ) end end Server local rootElement = getRootElement() function raceWin(rank) if rank ~= 1 then return end local playername = getPlayerName(source) givePlayerMoney(source,1500) outputChatBox("*Race: "..playername.." took $1500 for finishing first!",rootElement,255,153,0) end addEventHandler("onPlayerFinish", rootElement, raceWin ) function snm(mapName) outputChatBox("Trigger Doet het") exports.mapmanager:changeGamemodeMap(mapName) --executeCommandHandler("nextmap", source, mapName) end addEvent("nm", true) addEventHandler("nm", getRootElement(),snm) function mappenerin() local resourceTable = getResources() triggerClientEvent ( "clearGridList", getRootElement() ) for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) local type1 = getResourceInfo ( resourceValue, "type" ) local gamemode1 = getResourceInfo ( resourceValue, "gamemodes" ) if type1 == "map" and gamemode1 == "race" then triggerClientEvent ( "sendMaps", getRootElement(), name) else cancelEvent() end end end addEvent("dannyevent", true ) addEventHandler( "dannyevent", rootElement, mappenerin )
×
×
  • Create New...