Jump to content

Et-win

Members
  • Posts

    1,390
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Et-win

  1. -- local veh = getPedOccupiedVehicle(thePlayer) local vehiclepos = getPedOccupiedVehicle() The second code, look what is different and that is wrong. Also: bool respawnVehicle ( vehicle, vehiclepos ) Missed ',' and vehicle is not defined (in this script) + You can't give positions to respawnVehicle. Click on the code to see the wiki and read the first 3 sentences there.
  2. Get everything in the file as a string and put it on a variable. Get the position where you want to write and remove everything infront of that position and put that onto another variable. When you writed, paste the strings together and put them into a file (create a new file, overwrite it IF succeed) and save it. I think there better ways to do it, but atleast you are sure it won't overwrite is if you do it like this...
  3. Your resource needs ACL rights to ban by the way. To add them: 1. Open Admin Panel 2. Click resources tab 3. Manage ACL 4. Doubleclick on admin 5. Add object 6. enter: resource.resourcenamehere 7. Then ok.
  4. Et-win

    Help Please.

    if (accountName == "GrubaS") then
  5. Again, read the wiki. Syntax of code banPlayer: ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] ) Read the wiki from event 'onPlayerChat': https://wiki.multitheftauto.com/wiki/OnPlayerChat and you will find this: "The source of this event is the player who sent the chatbox message." Example: banPlayer(source, true, true, true, nil, "You were banned because of insulting words", 0) --This bans the player by IP, Username and Serial without a responsible player and permanently. banPlayer(source, true, false, false, nil, "You were banned because of insulting words", 15000) --This bans the player by IP without a responsible player and for 15 seconds. This: local adGuy = getPlayerFromName( source ) local adGuySerial = getPlayerSerial( adGuy ) if ( adGuy ) then Is not necessary.
  6. My bad, change to: for placeNumber, stringData in ipairs(banWords) do Guess I was very sleepy yesterday.
  7. No, it is not. banPlayer Click on it and read the wiki. This code has everything you need: Required Arguments bannedPlayer: The player that will be banned from the server. Optional Arguments NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments. IP: Will player be banned by IP? Username: Will player be banned by username? Serial: Will player be banned by serial? Note: to ban by username or serial, verifyserials must be enabled in the server configuration file. responsibleElement: The element that is responsible for banning the player. This can be a player or the root (getRootElement()) (Maximum 30 characters if using a string). reason: The reason the player will be banned from the server. seconds: The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.
  8. Et-win

    Question

    changeGamemodeMap All the mapmanager codes can be found here: https://wiki.multitheftauto.com/wiki/Mapmanager You have to use exports.mapmanager:
  9. Et-win

    Table Weapon

    giveWeapon Click on it and read the wiki. I already clearly said it in the code where to put it all.
  10. '123' and "123" are strings. 123 = int = number And it depends on how you save it. You can use the string too but then you have to put 'tonumber(string)' for example. Oh right, forgot that one. ^^
  11. If it doesn't output anything, then dLevel is not "100", besides, I think you meant: if dLevel == 100 then maybe? EDIT: setElementData(source, "LV", getAccountData(account, "LV") or "0") setElementData(source, "EXP", getAccountData(account, "XP") or "0") local dLevel = getAccountData(account, "LV") or 0 I don't understand why first 2 times "or "0"" and then "or 0" btw.
  12. Et-win

    Table Weapon

    Change 'player' to 'source'. EDIT: +I would use onPlayerSpawn, otherwise it won't work.
  13. What I said was an example, because I thought you knew how to script it with tables. banWords = { "Word1", "Word2", ---etc... } function checkChat(tMessage) for placeNumber, stringData(banWords) do if (string.find(string.lower(tMessage), stringData) ~= nil) then banPlayer(source) --Read the wiki for other parameters like IP ban, SERIAL ban, etc. end end end addEventHandler("onPlayerChat", getRootElement(), checkChat) Try to understand this script. If you don't, feel free to ask explanation
  14. Mmm, I would use a table for the words and loop through it with string.find, this was just an example because I thought you know how it should work. (Also change the addBan function's name, because addBan is a code for MTA) Anyway, but yes that will work but it will not check the player's their messages.
  15. Always read it on the wiki: https://wiki.multitheftauto.com/wiki/OnPlayerChat "The source of this event is the player who sent the chatbox message." So, with 'source'.
  16. That was supposed to be a smiley, but it spaced I see.
  17. elseif (tonumber(exp) >= 560001 and tonumber(exp) <=600000) then You know that it doesn't work when it's lower than 600000?
  18. local banWord = "shit" local string = "This is my SHIT string!" --Btw, use string.lower to get everything in the messages to lowercase if (string.find(string.lower(string), banWord) ~= nil) then outputChatBox("Ban this insulter! :O") end EDIT: Nice smiley space in my code ^^'
  19. Post the function if you want help. Or check if your data is actually 56001-60000
  20. string.find banPlayer --With event: onPlayerChat
  21. Et-win

    Table Weapon

    table = { {1, 2 ,3}, {4, 5, 6} } local gRandom = math.random(#table) for placeNumber, weaponData in ipairs(table[gRandom]) do giveWeapon(player, weaponData, ammo, current) end I hope you try to understand the code
  22. Well I don't know anything about the code which you are using because I never saw it, so I can't help you now.
  23. Et-win

    Table Weapon

    table = { {M4, MP5, etc} } You now can loop through them too.
  24. Are you even sure or the trigger gets send? Put a outputChatBox before it to be sure..
  25. John, he just gave you what I meant.......
×
×
  • Create New...