Jump to content

itHyperoX

Members
  • Posts

    522
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by itHyperoX

  1. Edit this function Upper(str) local first = utfSub(str,1,1):upper() return (first..utfSub(str,2,#str)) end function blockChatMessage(message) cancelEvent() outputChatBox(getPlayerName(source)..": "..Upper(message),255, 255, 255, true) end addEventHandler("onPlayerChat", getRootElement(), blockChatMessage)
  2. can't edit the post. Fixed. if getAccountData(getPlayerAccount(source),"acc.protect") ~= serial then logOut(source) kickPlayer(source,"Server","Not your account!")
  3. Hi everyone! i edited my "login", everything work fine, saving datas but, i made a "serial protect" to acccount. When you register, it set your serial, when you login, it check is this your serial if not the script kick you. So the problem is, when i trying to login to another account which is protected by "serial protect", the server kick the player who tried to login to another account, but reseting the datas i mean not saving your bank balance, or rcPoints, adminlevel etc.. Here is the login part: addEventHandler("onPlayerLogin", getRootElement(),function(_, account) local serial = getPlayerSerial(source) if getAccountData(getPlayerAccount(source),"acc.protect") ~= serial then kickPlayer(source,"Server","Not your account!") else triggerEvent("loadAccount",source,account) setElementData(source,"loggedin",true) exports["rc_notification"]:notification("You successfully logged in!",source,"info") end end) the triggerEvent: addEvent("accountBetoltese", true) addEventHandler("loadAccount",root,function (account) local playerX = getAccountData(account,"acc.pos_X") local playerY = getAccountData(account,"acc.pos_Y") local playerZ = getAccountData(account,"acc.pos_Z") local rotacio = getAccountData(account,"acc.Rot" or 0) local interior = getAccountData(account,"acc.interior" or 0) local dimenzio = getAccountData(account,"acc.dimension" or 0) local kinezet = getAccountData(account,"acc.skinID" or 0) local elet = getAccountData(account,"acc.health" or 0) local armor = getAccountData(account,"acc.armor" or 0) local bank = getAccountData(account,"acc.bank" or 0) local admin = getAccountData(account,"acc.admin" or 0) local rcPoints = getAccountData(account,"acc.rcPoints" or 0) local fegyverek = getAccountData(account,"acc.Weapons") local teamname = getAccountData(account,"acc.squad") local money = getAccountData(account,"acc.money") local team = teamname and getTeamFromName(teamname) or nil if playerX or PlayerY or playerZ then spawnPlayer(source, playerX, playerY, playerZ, rotacio, kinezet, interior, dimenzio, team) end if elet then setElementHealth(source, elet) end if money then setElementData(source,"acc.money",money) end if rcPoints then setElementData(source,"acc.rcPoints",rcPoints) end if armor then setPedArmor(source, armor) end if bank then setElementData(source,"acc.bank",bank) end if admin then setElementData(source,"acc.admin",admin) end if (fegyverek) and not (isPedDead(source)) then takeAllWeapons(source) for weapon, ammo in pairs(fromJSON(fegyverek)) do giveWeapon(source, weapon, ammo, true) end end setCameraTarget(source, source) end) I dont rlly know what can be the problem. Anyway, here is the onPlayerQuit, for saving the datas: addEvent("accountMentese", true) addEventHandler("accountMentese",root,function (account) local accountName = getAccountName(account) local x,y,z = getElementPosition (source) local _, _, rotacio = getElementRotation(source) local interior = getElementInterior(source) local dimenzio = getElementDimension(source) local team = getPlayerTeam(source) local kinezet = getElementModel(source) local elet = getElementHealth(source) local armor = getPedArmor(source) local bank = getElementData(source,"acc.bank") local admin = getElementData(source,"acc.admin") local rcPoints = getElementData(source,"acc.rcPoints") local money = exports["rc_core"]:getMoney(source) local finalteam = team and getTeamName(team) or nil local fegyverek = getAllPedWeapon(source) setAccountData(account,"acc.bank",bank) setAccountData(account,"acc.admin",admin) setAccountData(account,"acc.rcPoints",rcPoints) setAccountData(account,"acc.Rot",rotacio) setAccountData(account,"acc.money",money) setAccountData(account,"acc.dimension",dimenzio) setAccountData(account,"acc.interior", interior) setAccountData(account,"acc.squad",finalteam) setAccountData(account,"acc.skinID",kinezet) setAccountData(account,"acc.health",elet) setAccountData(account,"acc.armor",armor) setAccountData(account,"acc.pos_X", x) setAccountData(account,"acc.pos_Y", y) setAccountData(account,"acc.pos_Z", z) if (fegyverek) and not (isPedDead(source)) then setAccountData(account, "acc.Weapons", toJSON(fegyverek)) end end) onQuit.. addEventHandler("onPlayerQuit",root,function () local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then triggerEvent("accountMentese", source, account) end end) Thanks any help!
  4. setVehicleColor(veh,math.random(0,255),math.random(0,255),math.random(0,255))
  5. You can use the SA Editor, select the object, then copy everything to the @StormFighter script.
  6. No. So i tried to create the "cv" command, but when i create the vehicle, the "vehS + 1 not changing, so something wrong with that, i need help with that. so the car id is always 0 or 1..
  7. itHyperoX

    vehicle ID

    Hello, how can i make something thins? I want set id for each vehicle which is spawned. Then i can create /getcar command. I dont want to save this forever. local vehS = 0 function createVeh(player,CMD,veh) local vehName = getVehicleIDFromName(veh) local x, y, z = getElementPosition(player) if vehName == false then --- else vehS + 1 theveh = createVehicle(vehName,x+5,y,z) setElementData(theveh,"vehID",vehS) end end addCommandHandler("cv",createVeh)
  8. itHyperoX

    /login

    can i edit the /login command? I want that, when i type /login but no acc name or pw then outputChatBox("use /login accname pw")
  9. itHyperoX

    Player name

    Or you can make your custom using setElementData, getElementData. for /name addCommandHandler("name", function(player,cmd,...) local name = table.concat({ ... }, " ") if #name > 0 then setElementData("player.nick",name) end end ) -- for get getelementData(player,"player.nick") or "some error"
  10. Links not working, can u upload again pls
  11. you should test all the bugs with this script. Some of the players like using bugs. Try to pay /pay NAME 4664.4442 if is this work, you should fix it
  12. oh yes, i didn't see that. So i tried to make command for that error getAccountsBySerial expected string at argument 1 got nil function GetAccountNameFromSerial(serial) local accounts = getAccountsBySerial(serial) if accounts then for _,v in pairs(accounts) do outputChatBox(getAccountName(v)) end end end addCommandHandler("tes",GetAccountNameFromSerial)
  13. want to make something like this but i want the player account name by serial , not the serial addCommandHandler("getaccserial", function (player, cmd, accountName) if accountName then local account = getAccount(accountName) if (account) then outputChatBox("The serial is " .. getAccountSerial(account),player,255,255,255,true) else outputChatBox("Account not found") end end end)
  14. I want something this GetAccountsBySerial , but not numbers, i need the target player account name by serial
  15. dont comment here if you stupid, ty.
  16. Hi, how can i get the player account name by serial? (I need account name, not account numbers)
  17. type upgrade all , then everything updating
  18. i know... already done this. But i can not cancel this, because the "username" always changing. How can i cancel that? i tried with this addEventHandler ( "onClientChatMessage", root, function ( text ,username) if text == "No known account for '"..username.."'" then cancelEvent() end end)
  19. Hi. How can i cancel this, when player account not exist? login: No known account for 'sad' I want to cancel the "No known account for 'sad' message like this: if text == "ACL: Access denied for 'start'" then cancelEvent() end
  20. I want that, when player click on the button show the menu, if again click on the button hide the menu (remove the handler)
  21. if i click again on the button, remove the event handler
  22. addEventHandler("onClientClick", root, function(key, state, cx, cy) if isContactOpened == true then return end if key == "left" and state == "down" then if isCursorInBox(screenW * 0.4729, screenH * 0.3130, screenW * 0.0953, screenH * 0.0269) then isContactOpened = true addEventHandler("onClientRender",getRootElement(),contactBTN) else removeEventHandler("onClientRender",getRootElement(),contactBTN) isContactOpened = false end end end) mm.. How can i do this?
×
×
  • Create New...