Jump to content

Stanley Sathler

MTA Contributors
  • Posts

    563
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Stanley Sathler

  1. I guess not. You must create a function server-side and call it adding a custom event. Example: addEvent("myCustomEvent", true) function myFunction() -- ... your code goes here end addEventHandler("myCustomEvent", getRootElement(), myFunction) Later, call it from client-side triggerServerEvent("myCustomEvent", getRootElement())
  2. C'mon, why don't you explain here? What you need?
  3. "mysql_connect()"? It is a PHP function, not?
  4. Stanley Sathler

    Xampp

    I must open a new connection always when I wanna execute a Query, for example? Or I just need create a script with the connect functions and call it using onResourceStart?
  5. Stanley Sathler

    Help

    function CreateWantedGUI() wantedJanela = guiCreateWindow(76,58,171,21,"",false) editWanted = guiCreateEdit(76,58,171,21,"",false,wantedJanela) guiSetVisible ( wantedJanela, false) end addEventHandler("onClientResourceStart", getRootElement(), CreateWantedGUI) function Visible () guiSetVisible ( wantedJanela, not guiGetVisible(wantedJanela) ) showCursor(guiGetVisible(wantedJanela) ) end addCommandHandler ( "wantedstats", Visible )
  6. Alpha, but getPlayerMoney() also is server-side. Why it only gets the money of the localPlayer?
  7. Oh, you're using Lighter Blue (made by me). I'm very grateful. Seems a good job, I'll try when I get sometime.
  8. Well, is not right steal scripts from someone. But c'mon guys, we must be free and make free codes. We must colaborate with the community.
  9. Yes, there's many mistakes in your code. So, I'll give you a hint: create a function to create all GUI elements (windows, buttons, labels, etc) and set this function to "onClientResourceStart" event. And remember: in this function, set all elements to not visible (guiSetVisible(element, false)). So, when the player hits a marker, just use guiSetVisible(element, true) to set the elements visible.
  10. Opa, parece ter ficado ótimo. Para os demais, qualquer problema com o script, postem aqui mesmo (ou nos comentários na Comunidade (community.multitheftauto.com). A propósito Ninguem, no próximo resource, poste na categoria "Scripting". Ela também serve como um "Showroom", e manterá a comunidade portuguesa mais organizada. (: Forte abraço a todos, Stanley Sathler.
  11. local pZombieResource = getResourceFromName 'zombies' setTimer( function( ) local nHour = getTime( ) -- get hour if (nHour >= 0 and nHour <= 4) then if getResourceState( pZombieResource ) == 'loaded' then -- check startResource( pZombieResource ) -- start resource outputChatBox 'La horda de zombies ha comenzado!' end elseif nHour >= 4 then if getResourceState( pZombieResource ) == 'running' then -- check stopResource( pZombieResource ) -- stop resource outputChatBox 'La horda se ha detenido!' end end end, 1000, 0 ) - Try it. Is the Kenix example, but I modified the nHour condition. - I don't know if is it what you want, but between 0:00 and 4:00am, the zombie resource will be started.
  12. Stanley Sathler

    Help

    Solved! Guys, I'm working with Ninguem[ATZ] now and the server-side was created. Thank you for all replies. One love, Stanley Sathler.
  13. Yes, but it would be more complicated if compare with the creation of few buttons. You would create a rectangle (dxDrawRectangle()), some texts (to create the menu, using dxDrawText()) and insert the commands to arrow keyboard buttons.
  14. Can you explain better, Shadow?
  15. You're using GUI Editor? Why the variable names are not GUIEditor_Button[1] and GUIEditor_Button[3]? '-'
  16. Wiki is created by humans, and humans usually make mistakes. Maybe I'm not right, but never think that Wiki will always be correct.
  17. You must tell us: why did not work? The GUI isn't showed, certain function isn't called...?
  18. Hmm... I think he knows it. But wanna knows more about each arguments (better explained). Edikosh, I'm not good to explain it, I'm sorry.
  19. myonlake, is not hard. But we are not free scripters, then we don't wanna create a free script. If you read what I said, you'll see that JokeR is lazy and don't wanna work. Your example does work, but not for only admins. For it, you must increment to Jaysds example, getting the group of ACL.
  20. There's two ways: - Use my first example, when you use setElementHealth() - Use client-side script to use onClientPlayerDamage and trigger using triggerClientEvent().
  21. How myonlake said, the onPlayerDamage cannot be canceled (has no effect). So, for solve it, can do: function SetPlayerInvencible(attacker, attackerweapon, bodypart, loss) setElementHealth(source, getElementHealth(source)+loss) addEventHandler("onPlayerDamage", getRootElement(), SetPlayerInvencible)
  22. Seb:>, haha, don't worry. - Monty, and you? Solved your problem?
  23. There's an optional argument in function. Is the "water", where the level will be applied. If not specified, the function will apply the level on default world water, not? If I'm right, your example is incorrect, Blazy. You must use: --[[ .... ]] water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height ) setWaterLevel ( water, height ) --[[ ..... ]]
  24. @Seb, yes, I agree with you. But we need remember: between 1 and 288, there's some ID numbers that not exist. An example is the ID 8. Oh, and if he wanna set a specific group skin, maybe he must use a table. One love bro, Sathler.
  25. You're using createWater() to set the water level on map? If not, then setWaterLevel() will not be useful for you. *This affirmative needs revision - Anyway, check the positions. Maybe there's a incorrect number.
×
×
  • Create New...