Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by kieran

  1. Yet no new guys seem to use code snippets now... Maybe add some kind of detection for code and if it's there, like a function... Then it'd make a popup suggesting the code snippet button?
  2. @Medwar the first one there DOES set the players stats to max, in San Andreas there is a limit for these skills, if it got current skills and they were 500+ then it worked. The code is there now you need to go and make something so I can get a better of idea of what you are trying to do, for me that set my full stats. Go and look at the wiki, see if you can make it work the way you want it to.
  3. kieran


    @GalactixI read his script wrong, I thought the bracket was at the end of the function... Nesting is the second example he gave on original post, where you just put the word function under or beside the element that is triggering handler (separated by a comma of course), and then you add a closing bracket at the end of your function, below it or as most do (as it's proper way), you add it to the end of the last end in that function.... If that makes sense. I forgot to take that line out my post when I edited it.
  4. You seem like a new scripter, so one more thing... Check IIYAMA's topic where he explains the element tree, it is very useful.
  5. kieran


    When nesting a function in an event handler like this, don't use the function name. Just do the following. addEventHandler("onPlayerChangeNick", getRootElement(),wasNickChangedByUser)--wasNickChangedByUser is the function name. function wasNickChangedByUser()--removed onPlayerChangeNick, within these brackets you only pass returns from event handlers, functions etc. outPutChatBox ( " Your have been changed your nickname " ) end oldNick and newNick are what this event handler returns, an event handler is just something that happens when a player does a certain action (or event) and it
  6. You are adding event handler wrong, change the last line to addEventHandler("onPlayerLogin", root, setNickToAccount), please look at addEventHandler page on wiki, it explains why you use an element at argument 2.
  7. Yet I still don't know what you want to do with this script, please explain your goal and then I can see where you are going wrong.
  8. @NodZen_42 Try to use getPlayerTeam instead, this is both server and client side, and very reliable. local screenW, screenH = guiGetScreenSize() function drawTheImage () dxDrawImage(100, 100, 40,40,"mercenarios.png") end function teams_images () local playersTeam = getPlayerTeam(localPlayer) local TeamName = getTeamName ( playerTeam ) if TeamName == "Mercenarios" then addEventHandler("onClientRender", root, drawTheImage) outputChatBox('Player is in that team.') --Output a message to check if the script is working and you can't see the image. end end addEventHandler("onClient
  9. Is that the whole script? It seems that you have passed a string to the spamEngelle function, so "oyuncu" is now a string of text and not the player element. Are you using a command to trigger that function? Keep in mind I still have no idea at all what you are trying to do with this script... As I do not speak Turkish. But I will try and help.
  10. Please read thoroughly through this page in the wiki, it explains how you can start making your own scripts. Or look up scripting on MTA on YouTube, here is a quick YouTube video I just found. I hope this helps you!
  11. I not speak the Turkish , but if I am correct you are having troubles retrieving a players serial... For me your script is EXTREMELY confusing as I only speak English... So all I can tell you for now is to look at the returns from your event handlers. That and also to make sure you get the players account/element data (or whatever you use), so that you can pass it into the function. Please use /debugscript 3 and then we can get a better idea of the error... What line is the error coming from? What error are you getting? And finally what are you doing when you get this error? Pl
  12. You'll need to first create a function before the GUI is created. Now use GuiGetPosition to get the position of the image clicked (in your new function the image will be the source that triggered it), after this you just destroy the image (in new function) like this: destroyElement (source) Why create a function BEFORE the GUI is made I hear you ask? Well the way a computer reads code is top to bottom, so if you try pass a function, boolean or variable before it knows that it's there, it will get confused and say it's not there. Simple! Now that you have got the position of that
  13. You actually want setPedStat, setPlayerStat is the old one. And forget the table... If you just wish to set weapon stats, as I have previously said they are ID's 69-79. If you want to SET player stats for all weapons when that player spawns use the following script. function setStatsOnSpawn () for i = 69,79 do --We use a for loop to go through stats 69-79 (all weapon stats you can set) stat = setPedStat ( source, i, 1000 ) --We set the stat to full for the player (1000) end end addEventHandler("onPlayerSpawn", getRootElement(), setStatsOnSpawn) --When player spawns we trigger
  14. Yes what that script done was got the players CURRENT weapons stats, not their max weapon stats (I read your post wrong)... What exactly are you trying to do? Are you trying to get the max stats for all weapons? You can only set the stats of the following weapons. Weapon skills: Note: see Weapon skill levels for the values that advance weapon skills. 69: WEAPONTYPE_PISTOL_SKILL 70: WEAPONTYPE_PISTOL_SILENCED_SKILL 71: WEAPONTYPE_DESERT_EAGLE_SKILL 72: WEAPONTYPE_SHOTGUN_SKILL 73: WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL 74: WEAPONTYPE_SPAS12_SHOTGUN_S
  15. Apologies for double post, but the above post can no longer be edited. It appears there is no native function to get peds full stat, but after some quick research. All weapon stats on the getPedStat function have a maximum of 999 skill, except for pistol, sawn-off and micro-uzi which have a max skill of 500. So all weapon stat (EXCEPT for stat IDs 69, 73 and 75: Limit for these is 500) have a limit of 999.
  16. But will this not remove the wires from map?
  17. https://wiki.multitheftauto.com/wiki/OnPlayerSpawn https://wiki.multitheftauto.com/wiki/GetPedStat (use 69-79) From what I understand you want something like this.... function tellStatsOnSpawn () for i = 69,79 do --We use a for loop to go through stats 69-79 stat = getPedStat ( source, i ) --We get the stat from the source (the player) outputChatBox ( stat, source ) --And we output each stat to players chat end end addEventHandler("onPlayerSpawn", getRootElement(), tellStatsOnSpawn) --When player spawns we trigger function I have tested this and it works, but not 100% s
  18. I know that this is a nuisance... But would it be possible to replace the dff, col and txd of 1 single object instead of all objects with that ID? For example... If I created an object server side, could I pass that object to the client and only mod that one object? If not is there a way of adding new model IDs so I could create a new object as if it was from the original GTA list? I ask this as I am planning to modify a lot of objects in game, but only in certain places. If there is no way to do this, does anyone know where I can find a list of objects that were added to the game
  19. I have both SA Tools and kams script, there is now no problems with collision files, only dff and txd, check this topic for a more detailed explanation to how I made the object, applied textures etc.... I do not know where I am going wrong Also thanks for help with kams, that col system confused me a lot.
  20. I have been struggling now for months... I am trying to just make a simple object, with multiple textures that a player can enter... The collision (.col) loads fine, and works as expected, there is problems with the texture though and I think it might lay within the dff file when I exported it. To make this object I first made 1 floor and 1 wall, I then cloned the wall 3 times to make a box open at the top, I gave each of these cloned objects and the original one a name (front wall, back wall etc). After this I cloned the floor, I moved it up and cut a hole in the cloned object (now th
  21. This brings me back to the same point, what is your goal with this script? I can't help you until you help me understand what you are trying to do.
  22. You have declared "theVehicle" to be a function, it is not a function in your script. Please tell us what you're trying to do with this script, from what I can see you have tried to bind a key to a vehicle, it MUST be a function or a command.
  23. I have made a simple script to stop people advertising servers, it also converts all caps chat to lower case chat... There is of course many problems with this. Firstly, I need to use outputChatBox and fake the players chats when I convert upper case to lower case, so I need to get their name and output it with the text... This works okay, but I've noticed the original chat script is a little more complex, it gets the players nametag color and name, and outputs them... Is there a native event to output chat like the player sent it such as: "triggerServerEvent('outputChatBox', loc
  24. Sorry can't edit last post, but now I want to take it further and convert uppercase letters to lowercase, I've done this and it works with %l, my issue is that I don't know how I'd send it as if the player typed it to all other players, is there a native function to output a message like this or would I need to get the players name and tag color and do it manually? I know I can do just "outputChatBox(message)" on server side and all will see it, but would I need to add name and color to the start of that message? Or is their an easier way? function checkCaps( message, messageType )
  25. @Fist Thanks so much! For anyone wanting a sort of early version of the script I'm making or that's struggling for an answer, here is the working code. strings = { {'mtasa://', 'DO NOT ADVERTISE'}, --tablesting[1], outputmessage[2] } function checkText( message, messageType ) if messageType == 0 then for i=1,#strings do tablestring = strings[i][1] outputmessage = strings[i][2] findstring = string.find(tostring(message),tostring(tablestring)) if findstring then cancelEvent() outputChatBox(tostring(outputmessage), source, 255, 0, 0) end end end end addEve
  • Create New...