Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    same name

    ok my friend and me fixed it.
  2. Castillo

    same name

    <playerdb> <user account="Snake"> <character name="Optimus-Prime" age="15" skin="29" x="-1225.029296875" y="-126.671875" z="14.1484375" cash="3743800" redcolor="94" w0="0" a0="0" w1="0" a1="0" w2="24" a2="9980" w3="27" a3="9993" w4="29" a4="9896" w5="31" a5="9999" w6="34" a6="9998" w7="0" a7="0" w8="16" a8="9980" w9="43" a9="9999" w10="0" a10="0" w11="44" a11="0" w12="0" a12="0" wl="2" bank="99800484" int="0" dim="0" car1="511" car2="No car" car3="415" car4="422" rotation="167.59075927734" greencolor="242" bluecolor="191" /> </user> </playerdb> this?
  3. I've had problems before thats why i added it, like i click on any gui part not the element i want and it executes the function.
  4. Castillo

    same name

    Can someone help me out?
  5. Do you know about something called "mta wiki"? well there you can find showCursor function and check how it works.
  6. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(107,86,630,459,"saudi ! ~",false) GUIEditor_Image[1] = guiCreateStaticImage(67,31,516,380,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,395,119,55,"Close",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") function closeGUI () if (source == GUIEditor_Button[1]) then guiSetVisible ( GUIEditor_Window[1], false ) end end addEventHandler("onClientGUIClick",GUIEditor_Button[1],closeGUI,false)
  7. function closeGUI () if (source == YOUR_GUI_BUTTON_ELEMENT) then guiSetVisible ( YOURGUIWINDOW, false ) end end addEventHandler("onClientGUIClick",YOUR_GUI_BUTTON_ELEMENT,closeGUI,false)
  8. Castillo

    same name

    hi there, i've got a problem with my character system, i can create characters etc but the problem is that i can create with same names and thats a big problem, i've tryed to fix it and no luck. maybe someone of you can help me out, here is a piece of my code, function create_character (nametext,age,skin,red,green,blue) local root = getResourceConfig("character/playerdb.xml") local index = getUserIndex (getAccountName(getPlayerAccount(source)),root) for i , v in ipairs ( xmlNodeGetChildren ( root ) ) do local accName = xmlNodeGetAttribute ( v , "name" ) if ( accName == tostring ( nametext ) ) then outputChatBox ( "A character with that name already exists." , source , 255 , 0 , 0 ) return false end end Thanks in advance.
  9. No if i'm right this just works to dont keep pressing the forward key.
  10. If i'am right this script works like this, when you are in a car you press the cruise control key or command and it will just auto drive the car. thats what it does the one i have.
  11. ok, first error i see is that you using as event "onPlayerSpawn" and that even is only server side and your code its client so i suggets you to use triggerClientEvent to play the song. also [ bool looped = false? wth is this? there u just put "false" or "true"
  12. yea that worked, thanks.
  13. hey, i added a PM system into my player menu but the problem is that players can send empty messages so im trying to cancel that but dunno why dosnt works, here is my code. addEvent ("sendMsg", true) addEventHandler ("sendMsg", getRootElement(), function(msg,client) local givenplayer = getPlayerFromName ( client ) if( givenplayer ) then if msg == nil then outputChatBox ( "* PM from " .. getPlayerName(source) .. ": " ..msg.. ".", givenplayer, 243, 151, 12 ) else outputChatBox ("Error: You cant send empty messages.", source, 255, 0, 0, false) end end end) Thanks in advance.
  14. hey there, ive done a new admin system using levels and all works fine all see all working but a admin has a bug, he see only himself and i can see all players not only me can someone help me? Thanks in advance.
  15. function onResourceStart() local vehicles = getElementsByType( "vehicle" ) for k,v in ipairs(vehicles) do createBlipAttachedTo ( v, 0, 1, 255, 255, 0, 255 ) end end addEventHandler ( "onResourceStart", getRootElement(), onResourceStart )
  16. u can use this function, triggerClientEvent (source,"YOUR_CUSTOM_EVENT",source) then in client side: function showGUI() guiSetVisible(YOUR_GUI_ELEMENT,true) showCursor(true) end addEvent("YOUR_CUSTOM_EVENT", true) addEventHandler("YOUR_CUSTOM_EVENT", getRootElement(), showGUI)
  17. First put your code into [lua][/lua] tags
  18. hey all, ive found a problem at my server, when i quit/logout it saves all data but when i close server dosnt saves any data and i lose all, position, money, etc, have anyone idea how i can fix this problem? thanks in advance.
  19. I dont know since i never used race game mode.
  20. well for all you need to learn how to script, nobody will make it for you for free.
×
×
  • Create New...