Jump to content

BinSlayer1

Members
  • Posts

    491
  • Joined

  • Last visited

Everything posted by BinSlayer1

  1. clientside errors: addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) should be in the createLoginWindow function also: triggerServerEvent("submitLogin", getRootElement(), username, password) should be: triggerServerEvent("submitLogin", getLocalPlayer(), username, password) About the server side part, why are you checking is username is 'user' and pass is 'apple' ? Doesn't make any sense Also.. spawn(source) ? spawn is no predefined function.. that would be spawnPlayer https://wiki.multitheftauto.com/wiki/SpawnPlayer
  2. Example 3 combined with Example 1 in general, but if the code is easy as pie give it fully
  3. *I Think* He Means That A Sentence Should Start With A Capital Letter And Then Go On With LowerCase Letters
  4. No, it's executed when the file has been downloaded (the .lua file) This means that while the lua file has been downloaded, the shader files may have not been and executing them will not work However, this should not be a problem if the resource was already downloaded somehow
  5. They say third time's a charm but perhaps you need to quintuple post. (5 posts)
  6. Not true @ CapY This used to be a bug in the early stages of the 1.1 release, however the very first few nightlies fixed this. And now the fix is implemented in 1.1.1 too so he will not encounter the issue
  7. Why don't you elaborate on that one?
  8. how would we know? the number of vehicles depends on how many times the function kupSamochod is called also the code looks messy with all that polish stuff and no indentation and you don't even post the full clientside because we dont know how you're calling kupSamochod
  9. what do you mean you start it and you use the admin panel? All you have to do is start the script and reconnect.. see if when you join you get sent to the red team
  10. and outputChatBox should be visible to the source not thePlayer also, never use 'source' as function parameter because source is an internal variable passed from an event that is attached to it and you should never define source yourself; it's what you can call a 'hidden variable'
  11. https://wiki.multitheftauto.com/wiki/Sho ... dComponent use it with "vehicle_name" as string for component this will hide it, if you want to change it you need to script it somehow maybe with dxDrawText
  12. if you want to store passwords from now on you can do it by adding an command handler "login" with 2 arguments (strings) passed and the 2nd one would be the password so you can store it somehow but it's very very risky I mean you should consider the security issues but the players would have to follow this exact pattern of logging (using /login ) so your password logger can be accurate PS: You should really just daily-backup everything in the MTA folder instead.
  13. it is? getAccountData returns strings afaik and setVehicleColor requires integers I'm surprised it works I would have thought you needed to tonumber it
  14. mrvicio if you read what Cadu12 told you, you would know it's executeCommandHandler("debugscript",source, "3") the order matters (check the wiki) + the argument must be a string so use "3" not 3. although i'm not sure executeCommandHandler will work with this built-in command
  15. What's that? You need a detection system for when somebody dies and you need to figure out who killed him AND add kills = kills + 1 for the killer There's no way of doing this other than using onPlayerWasted with all the parameters including 'killer'
  16. you're adding the collumns indeed but I can't see any function that would actually detect the number of kills, etc. So you can't use "getPlayerKills" because scripting is not magic, you need to create getPlayerKills so it can actually get the player's kills. https://wiki.multitheftauto.com/wiki/OnPlayerWasted
  17. Neither. onPlayerSpawn does not have a vehicle or the RGB Colors as parameters.. and the only way to get it is to use getPedOccupiedVehicle and then getVehicleColor(theVehicle, true) BUT: You can't expect getPedOccupiedVehicle to return a vehicle element WHEN THE PLAYER SPAWNS. Players most likely spawn on foot. So you need to reconsider the event. Use something else
  18. why use onClientPlayerSpawn just to trigger a serverside event? Use onPlayerSpawn instead: https://wiki.multitheftauto.com/wiki/OnPlayerSpawn But you can't really save the colors onPlayerSpawn or onPlayerQuit because the player will not be in a vehicle in either of these events What you can do is check the colorpicker and right when a player chooses a color for a vehicle send the vehicle name + colors as parameters in a server event and afterwards use setAccountData with a key like "vehicles."..vehName and then save the rgb colors Just an idea
  19. I prevented it because any other player would not be aware of the explosion except the source of the onPlayerWasted (to whom I'm triggering the event to create an explosion to) You need to understand the difference between clientside and serverside before you learn anymore of scripting
  20. I believe you have to create the explosion clientside only for the 'source' --serverside function onKill(ammo, killer, weapon, bodypart) if killer and killer ~= source and getElementType ( killer ) == "player" then local x, y, z = getElementPosition(source) --createExplosion (x, y, z, 10) triggerClientEvent(source, "explodeMe", source, x, y, z, 10) outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) end end addEventHandler("onPlayerWasted", getRootElement(), onKill) --clientside addEvent('explodeMe', true) addEventHandler('explodeMe', getRootElement(), function(x,y,z,type) createExplosion (x, y, z, type) end )
  21. BinSlayer1

    need help

    well thePlayer = nil because onClientRender has no parameters and that's not the proper way of checking if someone is an admin, not mentioning you shouldn't check if someone is an admin every single frame.. All in all, this kind of script is something that is very hard to achieve for someone who doesn't know much about scripting @-=I Blaawee I=- : I suggest you try to do easier things so you can learn more
  22. BinSlayer1

    need help

    you're gonna have to call a server event because getPlayerIP is only serverside https://wiki.multitheftauto.com/wiki/GetPlayerIP so call the server event, get the IP of the source, send the data back to the client and when it gets sent use guiSetText(ip1, "IP String") https://wiki.multitheftauto.com/wiki/GuiSetText
  23. What's the point in that? Simply using fileDelete(file.lua) at the end of all files you want to 'protect' should do the job
  24. why? just use the code.. if it doesnt work post here
  25. function vehicle(thePlayer, cmd, ...) local vehName = table.concat({...}, " ") local x, y, z = getElementPosition ( thePlayer ) local id = getVehicleModelFromName ( vehName ) spawnVehicle( id, x+3, y+3, z ) end addCommandHandler("spawnveh", vehicle)
×
×
  • Create New...