Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. get/setPedSkin is deprecated, you should use get/setElementModel instead.
  2. The truth is, I don't even know how your system works, I just did what you wanted, the rest was suposed to be done by you, or at least post the WHOLE script.
  3. Maybe you should search, and not make 3 posts just to get help.
  4. Castillo

    help dude

    You welcome. P.S: Try to understand the script, I'll not give you the code always.
  5. Castillo

    help dude

    I'm not crazy, triggers are used for this kind of script. P.S: Have you tested it? do you know how to setup a client and a server side script?
  6. dragon, that's because his reply was the same code as mine, but added "1" which is not required. Now, did you set the element data to the player? if you didnt, then it'll never work. function onGUIClick() if (source == cityButton) then setElementData(localPlayer,"route","city") elseif (source == countryButton) then setElementData(localPlayer,"route","country") end end addEventHandler("onClientGUIClick",root,onGUIClick) Of course, you need the two buttons.
  7. WRONG He's talking about BLACK SCREEN, I didn't know the screen was a GUI element , oh, hold on, that's because is not. fadeCamera(false) put's the screen in the color you choose (default is black).
  8. You welcome. And... https://wiki.multitheftauto.com/wiki/Has ... rmissionTo -- To check if a player has permission to that function. https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup -- To check if an account is in the ACL group inserted. P.S: These functions are only server side.
  9. I did, I gave you the things you will need, which is help, but not according to you, full code is the help in your dictionary. and, I don't want to help? Yeah yeah, right. I'm not like Castillo, that's true, but I help, at least I try. What do you mean "Like Castillo"? you mean that I give out the code? if so, I don't do that always, just some times.
  10. Castillo

    help dude

    Firstly, stop spamming to get attention, that's not the way this works. Second, you are messing client & server functions in one script, that'll never work, you need triggers. -- client side GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(262,309,315,265,"",false) ServerNameLabel = guiCreateLabel(0.2825,0.1358,0.3587,0.1132,"name",true,GUIEditor_Window[1]) function onresourceStart () bindKey ("p", "down", dude) end addEventHandler("onClientResourceStart", resourceRoot, onresourceStart) function dude () guiSetVisible (GUIEditor_Window[1], true) showCursor (true) triggerServerEvent("getServerName",localPlayer,localPlayer) end addEvent("returnServerName",true) addEventHandler("returnServerName",root, function (serverName) guiSetText ( ServerNameLabel, "Name: [ " .. tostring(serverName) .. " ]" ) end) -- server side addEvent("getServerName",true) addEventHandler("getServerName",root, function (client) local serverName = getServerName( ) triggerClientEvent(client,"returnServerName",client,serverName) end) Should work.
  11. Nice, keep up the good work! I'll surely try it when you release it .
  12. Castillo

    Matrix cams

    By trigger I guess he meant, use, example via command, event handler, whatever you want.
  13. routes = {} routes["city"] = { { { x=1802.39, y=-2072.26, z=13.64, hint = "City Bus Line, just follow the checkpoints." }, { x=1964.35, y=-1959.11, z=13.79 }, { x=1784.24, y=-1826.28, z=13.51, hint = "Bus Stop 1 : Unity Station", stop = true }, -- and all my checkpoints/stops for this route } } routes["country"] = { { { x=1802.39, y=-2072.26, z=13.64, hint = "Country Bus Line, just follow the checkpoints." }, { x=1964.35, y=-1959.11, z=13.79 }, { x=1784.24, y=-1826.28, z=13.51, hint = "Bus Stop 1 : Unity Station", stop = true }, -- and all my checkpoints/stops for this route } } I would use element data to set the routes, then you can do this: local function newRoute( player ) p[ player ].vehicleOnResourceStart = nil local route = math.random( #routes[getElementData(player,"route")] ) p[ player ].route = routes[getElementData(player,"route")][ route ] p[ player ].checkpoint = 0 advanceRoute( player ) end But, I think you'll need to modify advanceRoute function also. Try with that (Not tested).
  14. Wrong Jaysd1, you got missing "()" in getLocalPlayer. The only problem with JR10's fix is that he miss g_Root = getRootElement(), but that was not needed, so he took it off, but forgot to change it in the event handler. --------------------------- -- lock vehicle --------------------------- function lockcar() local pojazd = getPedOccupiedVehicle(localPlayer) if pojazd then if isVehicleLocked (pojazd) then outputChatBox("Pojazd jest juz zamkniety!") -- "Car is locked!" else outputChatBox("Pojazd zostal zamkniety.") setVehicleLocked (pojazd, true ) end end end addCommandHandler('lock', lockcar) --------------------------- -- unlock vehicle --------------------------- function unlockcar() local pojazd = getPedOccupiedVehicle(localPlayer) if pojazd then if isVehicleLocked (pojazd) then outputChatBox("Pojazd zostal otworzony.") setVehicleLocked (pojazd, false ) else outputChatBox("Pojazd jest juz otoworzny!") -- "car is opened!" end end end addCommandHandler('unlock', unlockcar) --------------------------- -- auto unlock vehicle --------------------------- addEventHandler("onClientVehicleStartExit", root, function() local pojazd = getPedOccupiedVehicle(localPlayer) if isVehicleLocked (pojazd) then -- When player want to exit locked car it's been opened. outputChatBox("Pojazd zostal otowrzony.") setVehicleLocked (pojazd, false ) end end )
  15. Castillo

    Freeroam

    You can't just put all that into a table, if you are trying to make a GUI like freeroam does, then see how they work.
  16. -- server side function DestructionMoney2() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local playername = getPlayerName(alivePlayers[1]) local serial = getPlayerSerial(alivePlayers[1]) triggerClientEvent(alivePlayers[1],"playTheSound",alivePlayers[1]) end end -- client side addEvent("playTheSound",true) addEventHandler("playTheSound",root, function () local sound = playSound("sounds/lastmen.mp3") setSoundVolume(sound, 0.5) end)
  17. You are not checking if the player who hit it is the localPlayer, must be that. function onMarkerHitGiveVehicle(hitPlayer) if (hitPlayer == localPlayer) then if getPlayerTeam(hitPlayer) == getTeamFromName("Teamname") then showCursor(true) guiSetVisible(window,true) end end end for i,marker in ipairs(markers) do addEventHandler("onClientMarkerHit",marker,onMarkerHitGiveVehicle) end Try it.
  18. Maybe you say that because he gives you the code?
  19. It's nice, but what I've seen in the video is a lag spike when driving, I guess you'll fix that as soon as you know how to. Nice work.
  20. Castillo

    spect count

    Cierro el tema para que no hagan spam ni posten fuera del tema. brad, avisame si quieres que lo re-abra.
  21. Castillo

    spect count

    Para eso necesitaras editar MUCHO el script, te recomiendo que empieces a leerlo .
  22. getAccounts() returns ALL server accounts, offline or online.
  23. Do you mean, you want to check EVERY account for that character name?
×
×
  • Create New...