Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. addEventHandler("onClientGUIChanged", root, function () if (source == redEdit or source == greenEdit or source == blueEdit) then local red = guiGetText ( redEdit ) local green = guiGetText ( greenEdit ) local blue = guiGetText ( blueEdit ) if ( red ~= "" and green ~= "" and blue ~= "" and tonumber(red) and tonumber(green) and tonumber(blue) ) then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then setVehicleHeadLightColor(veh, red, green, blue) end end end end )
  2. You can use this event handler: onClientGUIChanged, it'll detect when the selected GUI edit field or memo text changes. You can set the head lights color client side, as it would be a preview.
  3. For now I only sell MTA scripts, I haven't got the time yet to learn PHP, HTML and so on. P.S: We should stop doing off-topic.
  4. I've started the game mode on my local server and it works, I login and the camera fades in.
  5. First one is correct. By the way: You must stop the server before editing the ACL, else it'll undo the changes you've made.
  6. You can use this: for index, team in ipairs(getElementsByType"team") do -- Loop through all server teams. -- Do something. end
  7. School didn't start for me yet, and I don't work, well, I'm a paid scripter, that's my current "work".
  8. Try adding the resource 'zombiegamemode' to acl.xml group "Admin".
  9. Well, I guess you have defined the team when you create them, like this: team1 = createTeam("Test 1", 255, 255, 255) team2 = createTeam("Test 2", 255, 255, 255) function balanceTeams ( thePlayer ) local Count1 = countPlayersInTeam (team1) local Count2 = countPlayersInTeam (team2) if (Count1 == Count2) then setPlayerTeam ( thePlayer, team1 ) elseif (Count1 > Count2) then setPlayerTeam ( thePlayer, team2 ) elseif (Count1 < Count2) then setPlayerTeam ( thePlayer, team2 ) end end
  10. Well, you can use countPlayersInTeam to count players in a team.
  11. You want to make a script which will check the players in each team and output the names with players to chat? If so: addCommandHandler getTeamFromName countPlayersInTeam
  12. Try this: lights = guiCreateWindow(211,276,322,202,"Vehicle Headlight - $2500",false) guiSetVisible(lights, false) redEdit = guiCreateEdit(110,54,142,24,"",false,lights) greenEdit = guiCreateEdit(110,87,143,26,"",false,lights) blueEdit = guiCreateEdit(108,125,149,27,"",false,lights) redtx = guiCreateLabel(39,58,64,19,"Red, 0-255:",false,lights) greentx = guiCreateLabel(24,93,75,19,"Green, 0-255:",false,lights) bluetx = guiCreateLabel(32,129,67,17,"Blue, 0-255:",false,lights) buyVLightsButton = guiCreateButton(97,176,70,17,"Purchase",false,lights) cancelPurchaseButton = guiCreateButton(166,176,74,17,"Cancel",false,lights) addEventHandler ( 'onClientGUIClick', root, function ( ) if (source == bMechanicNine ) then guiSetVisible(lights, true) elseif ( source == buyVLightsButton ) then local red = guiGetText ( redEdit ) local green = guiGetText ( greenEdit ) local blue = guiGetText ( blueEdit ) if ( red ~= "" and green ~= "" and blue ~= "" and tonumber(red) and tonumber(green) and tonumber(blue) ) then if ( isPedInVehicle ( localPlayer ) ) then local veh = getPedOccupiedVehicle ( localPlayer ) triggerServerEvent("onHeadLightsChange",localPlayer,veh,red,green,blue) else outputChatBox ( 'You are not in a vehicle!' ) end end elseif ( source == cancelPurchaseButton ) then guiSetVisible ( lights, false ) showCursor ( false ) end end )
  13. https://wiki.multitheftauto.com/wiki/DbConnect
  14. http://es.wikipedia.org/wiki/MySQL
  15. addEvent("onHeadLightsChange",true) addEventHandler("onHeadLightsChange",root, function (currentVehicle, red, green, blue) if (currentVehicle) then if exports.global:hasMoney(source, 2500) then -- Your player argument is 'source' not 'player. exports.global:takeMoney(source, 2500) -- Your player argument is 'source' not 'player. setVehicleHeadLightColor ( currentVehicle, tonumber(red) or 255, tonumber(green) or 255, tonumber(blue) or 255 ) outputChatBox ( 'You have changed your vehicle lights!', source ) else outputChatBox ( 'Not Enough Cash!', source ) end end end )
  16. Go to settings -> Interface -> Change skin to "Lighter Black".
  17. Yo supongo que usan MySQL.
  18. Use triggerClientEvent in the server side, that'll trigger a event to the client side where you can use guiSetVisible.
  19. Are you sure? because it didn't show the window when I tested it.
  20. lights = guiCreateWindow(211,276,322,202,"Vehicle Headlight - $2500",false) guiSetVisible(lights, false) redEdit = guiCreateEdit(110,54,142,24,"",false,lights) greenEdit = guiCreateEdit(110,87,143,26,"",false,lights) blueEdit = guiCreateEdit(108,125,149,27,"",false,lights) redtx = guiCreateLabel(39,58,64,19,"Red, 0-255:",false,lights) greentx = guiCreateLabel(24,93,75,19,"Green, 0-255:",false,lights) bluetx = guiCreateLabel(32,129,67,17,"Blue, 0-255:",false,lights) buyVLightsButton = guiCreateButton(97,176,70,17,"Purchase",false,lights) cancelPurchaseButton = guiCreateButton(166,176,74,17,"Cancel",false,lights) addEventHandler ( 'onClientGUIClick', root, function ( ) if (source == bMechanicNine ) then guiSetVisible(lights, true) elseif ( source == buyVLightsButton ) then local red = guiGetText ( redEdit ) local green = guiGetText ( greenEdit ) local blue = guiGetText ( blueEdit ) if ( red and green and blue ) then if ( isPedInVehicle ( localPlayer ) ) then local veh = getPedOccupiedVehicle ( localPlayer ) triggerServerEvent("onHeadLightsChange",localPlayer,veh,red,green,blue) else outputChatBox ( 'You are not in a vehicle!' ) end end elseif ( source == cancelPurchaseButton ) then guiSetVisible ( lights, false ) showCursor ( false ) end end )
  21. Oh, I didn't get your right I guess. Use this: local pickups = { [createMarker ( 1978.5877685547, 1026.3675537109, 993.50002441406, "cylinder", 1, 100, 100, 100, 170 )] = {weapons = {[8] = 1, [32] = 550, [16] = 100, [24] = 207}, skin = 111, armor = 0}, [createMarker ( 1978.5877685547, 1026.3675537109, 993.50002441406, "cylinder", 1, 100, 100, 100, 170 )] = {weapons = {[8] = 1, [32] = 550, [16] = 100, [24] = 207}, skin = 112, armor = 0} } addEventHandler("onResourceStart",resourceRoot, function () for marker, markers in pairs(pickups) do setElementInterior (marker, 10) addEventHandler( "onMarkerHit", marker, mafiamarker ) end end ) function mafiamarker (hitElement, matchingDimension) local elementType = getElementType( hitElement ) if (elementType == "player") then local pickup = pickups[source] setElementModel ( hitElement, pickup.skin ) setPlayerTeam ( hitElement, teammaffia ) takeAllWeapons ( hitElement ) for weapon, ammo in pairs(pickup.weapons) do giveWeapon ( hitElement, weapon, ammo, true ) end setPedArmor ( hitElement, pickup.armor ) end end
  22. Well, that'll be really bad when you try to destroy the trailers, I would suggest using a table to store trailers.
×
×
  • Create New...