Jump to content

CTCCoco

Members
  • Posts

    93
  • Joined

  • Last visited

Everything posted by CTCCoco

  1. I have a little problem with the GUI. First the " player se ha conectado " doesn't appears. That means that the onClientPlayerJoin doesn't active but why? Second the GUI doesn't appears when the player is in the " posicionjug1 ". wtf? I have the client script in client/guibotones.lua in my resource RLC and this is my resource meta: <meta> <?xml version="1.0" encoding="UTF-8" ?> <info author="Coco" type="gamemode" name="RLC" description="RLC" /> <script src="spawn.lua" /> <script src="comandos.lua" /> <script src="registrarse.lua" /> <script src="client/guibotones.lua" type="client" /> meta> I don't receive any errors on the console and anything. And this is the Client GUI code: ---------------------------------SCRIPT DE LOS BOTONES ( GUI ) CLIENT-SIDE ---------------------------------SE CREA LA VENTANA function crearComprarCasasWindow() for houses=0 , casasnum do local hEntrancex = xmlNodeGetAttribute ( casasxml, "hEntradax." .. houses ) local hEntrancey = xmlNodeGetAttribute ( casasxml, "hEntraday." .. houses ) local hEntrancez = xmlNodeGetAttribute ( casasxml, "hEntradaz." .. houses ) local posicionjugS1 = createColSphere( hEntrancex, hEntrancey, hEntrancez, 3.0) local posicionjug1 = isElementWithinColShape ( thePlayer, posicionjugS1 ) if(posicionjug1) then local casasxml = xmlLoadFile("casas.xml") windowTituloCasa = guiCreateWindow(460,289,357,171,"Sistema de casas por CTCCoco",false) local hOwner = xmlNodeGetAttribute (casasxml, "hOwner." .. houses ) labelDuenoCasa = guiCreateLabel(10,29,335,18,"Dueno:" .. hOwner,false,windowTituloCasa) guiLabelSetColor(labelDuenoCasa,255,255,255) guiLabelSetVerticalAlign(labelDuenoCasa,"top") guiLabelSetHorizontalAlign(labelDuenoCasa,"left",false) local hDesc = xmlNodeGetAttribute (casasxml, "hDesc." .. houses ) labelDescripcionCasa = guiCreateLabel(8,47,340,45,"Descripcion: " .. hDesc,false,windowTituloCasa) guiLabelSetColor(labelDescripcionCasa,255,255,255) guiLabelSetVerticalAlign(labelDescripcionCasa,"top") guiLabelSetHorizontalAlign(labelDescripcionCasa,"left",false) local hValue = xmlNodeGetAttribute (casasxml, "hValue." .. houses ) labelPreAlqCasa = guiCreateLabel(8,94,334,34,"Precio: " .. hValue .. "$ Alquiler:",false,windowTituloCasa) guiLabelSetColor(labelPreAlqCasa,255,255,255) guiLabelSetVerticalAlign(labelPreAlqCasa,"top") guiLabelSetHorizontalAlign(labelPreAlqCasa,"left",false) botonComprarCasa = guiCreateButton(10,136,89,25,"Comprar",false,windowTituloCasa) botonCancelarCasa = guiCreateButton(259,136,89,25,"Cancelar",false,windowTituloCasa) guiSetVisible(windowTituloCasa, true) return 1 else guiSetVisible(windowTituloCasa, false) return 1 end end end function WindowComprarCasa() crearComprarCasasWindow() --outputChatBox("* " .. getPlayerName(source) .. " esta owneando el server.") end --------------------CUANDO EL JUGADOR SE CONECTA REPITE ESTO CADA SEG. function remotePlayerJoin() --outputChatBox("* " .. getPlayerName(source) .. " has joined the server") setTimer (WindowComprarCasa, 3000, 0) outputDebugString("* " .. getPlayerName(source) .. " se a conectado.") end addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin) Please I need some help. Thanks.
  2. EDIT: The difference its here http://www.lua.org/pil/4.2.html
  3. I mean for create a GUI for example a Buy a House GUI or LOGIN GUI. How you get the coordinates? Magic? Thanks for help a noob
  4. How I can get the X and Y coordinates to make a text and a GUI in the player window? Please help. Thanks.
  5. In SA:MP you see a text for " x " milliseconds and the text dissapear. There are many types of text in SA:MP. But I don't means a static text ( with shadow,etc ) only a little text for show something. Example: This car is for sale. Price: 3000$ when a player its near http://wiki.sa-mp.com/wiki/GameTextForPlayer and http://wiki.sa-mp.com/wiki/GameTextStyle Thanks for all
  6. How I can do something like GameTextForPlayer on SA:MP in MTA? Thanks.
  7. PROBLEM SOLVED Using: bool isElementWithinColShape ( element theElement, colshape theShape )
  8. How I can do a chatbox like this? Thanks.
  9. Something more direct please? Thanks for the help. http://lmgtfy.com/?q=lua+for+loop But seriously, just look around in google, search for lua for loop examples, etc. Sorry for do questions here.
  10. Something more direct please? Thanks for the help.
  11. Where I can learn the for( and do( fuctions? Thanks
  12. use xmlSaveFile afterwards.. It is created, but it's not written to the disk yet, it's created in the server memory. It works. Thanks.
  13. I try xmlCreateFile("creado.xml", "newroot") and xmlCreateFile(":RLC/creado.xml", "newroot") but the server don't create anything. I don't receive a error and anything. Please help me. Thanks.
  14. I'm not very good in PAWN but if I'm correct you're defining the table size with "RegistroPaso1[MAX_PLAYERS] = 0". In lua that's not neccesary, you just create a table using "RegistroPaso1 = { }", the size does not matter, it dynamically adapts itself as more values are added. Also, in MTA players don't have id's, you'll have to script that, they do all have a unique key, each player is an element. So in lua RegistroPaso1[playerid] = 0; would be RegistroPaso1[element] = { } Here's an example. RegistroPaso1 = { } function blaBla( source, command ) RegistroPaso1[source] = { } end addCommandHandler ( "bla", blaBla ) I recommend reading this: http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html In Pawn you can create RegistroPaso1 = 0; but it is only a var for all players. I want do a variable that a player can have == 1 and other player have == 0. I mean: CTC_Coco -> RegistroPaso1 == 1 Other_Player -> RegistroPaso1 == 6 Other -> RegistroPaso1 == 0 etc etc. Please help me and thanks.
  15. How I can create something like RegistroPaso1[MAX_PLAYERS] = 0; and you use RegistroPaso1[playerid] = 0; on SA:MP but in MTA? Thanks.
  16. This isn't the error. Is a stupid error that I do in the post but it doesn't work with the ". Please help me. I don't get the message now. I don't get anything no message and nothing only if you don't put the name of the level of admin get a error but if you put all correct you don't get anything [ PROBLEM SOLVED] Please help and thanks .
  17. I don't know why but I can't save a file with MTA:SE. I think is bugged on my computer for something strange. Thanks for all you are the best . I will write if I have more problems.
  18. 1. Its possible do a house / bussiness system with XML fuctions? 2. Why if I use xmlCreateFile ( ":RLC/houses, "HouseSystem" ) or xmlCreateFile ( "houses, "HouseSystem" ) don't create anything ? 3. Why If I change some Data manually like the Player Level to 4 or something and when the player connect to the server change it to 0 automatic? 4. Why this makeadmin command doesn't works? ( You put the things /haceradmin (name of the player) (level of admin) and says: "you must put /haceradmin blabla all the time ) Code: function ComandoPagar(thePlayer, theCommand, theTarget, amount) if theTarget then local giveTo = getPlayerFromName(theTarget) end if amount then amount = tonumber(amount) end if giveTo and amount then amount = math.floor(amount) if giveTo == thePlayer then outputChatBox("Error: No puedes darte dinero a tí mismo.", thePlayer) elseif amount < 1 then outputChatBox("Error: No puedes enviar nada...", thePlayer) elseif getPlayerMoney(thePlayer) < amount then outputChatBox("Error: No tienes $" .. amount, thePlayer) else setAccountData(getPlayerAccount(giveTo), "RLC.NivelAdmin", amount) outputChatBox(getPlayerName(thePlayer) .. " te ha dado nivel" .. amount" de admin", giveTo) outputChatBox("Has dado " .. amount .. " de nivel de admin a " .. theTarget, thePlayer) end else outputChatBox("Escribe /" .. theCommand .. " <nombre> <nivel de admin>", thePlayer) end end addCommandHandler("haceradmin", ComandoPagar) Thanks for all people. Please help me I need learn :DD
  19. I don't know what to do to give money to a specific connected player. Please help me. function ComandoDinero(thePlayer, comando, thePlayerQ, dinero) if(thePlayerQ) then givePlayerMoney(thePlayerQ, dinero) outputChatBox ( ""..getPlayerName(thePlayer).." te ha dado " .. dinero .." dolares", thePlayerQ) else outputChatBox ( "Usa /dardinero <nombrejugador> <cantidad>", thePlayerQ ) end end addCommandHandler("dardinero", ComandoDinero)
  20. Thanks I will try now. I use the wiki. I can't script without the wiki in this moment Thanks :DD
×
×
  • Create New...