1LoL1
-
Posts
944 -
Joined
-
Last visited
Posts posted by 1LoL1
-
-
Hey guys,
I want to ask you a question, I scripted a script, and my problem when I do an action the message out put too slow, it takes about 5 to 10 seconds to appear at the chatbox.
Can you guess to me from where that can be caused?
Post the code.
-
Any error/warning?
-
I want to check and see if a new player registered, how would I do it?
Because I want to give money if it's a new player registered. But on my login, you register then it takes you back to login and press login.
If anyone can help it'll be helpful!
addEventHandler("onPlayerLogin", getRootElement(), function (_, acc) if getAccountData(acc, "wb") then outputChatBox("Welcome back!") else setAccountData(acc, "wb", "test") outputChatBox("Welcome new player!") end end)
-
someone knows the author of this resource?
https://community.multitheftauto.com/index.php?p=resources&s=details&id=12711
TAPL
-
I drew an image on my login screen but the image does not work for every resolution.
local Width,Height = 350,350 local x, y = guiGetScreenSize() local px, py = 1980, 1080 local sx, sy = (x/px), (x/py) Image = guiCreateStaticImage( x/2-640, y/2-360, 1980, 1280, "login_bg.png", false)
Can anybody help me how do I make it work for every resolution?
Try this but start in 800x600 resolution.
x, y = guiGetScreenSize() rx, ry = (x/800), (y/600) image = guiCreateStaticImage(rx*640, ry*360, rx*1980, ry*1280, "login_bg.png",false)
-
dbExec ( sql, "CREATE TABLE IF NOT EXISTS selling (userid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, item VARCHAR(30), amount INT(6), price INT(6))" )
-
Post the "onSpawnPoliceOfficerLS"
-
local players = getPlayerTeam(source) if players and getTeamFromName("DX") == players then setElementModel(source, id) else setElementModel(source, 0)
-
Use a timer to make it constantly move up and down.
1500 is a timer.
-
It's marker not market.
marker = createMarker( x, y, z, "cylinder", 1.5, 255, 255, 0, 170 ) addCommandHandler("move", function () moveObject(marker, 1500, x, y, z) end)
-
What is function open?
-
Instead of
setAccountData(account,"cash",playerCash+betAmount+betAmount*2)
You can just use
givePlayerMoney(thePlayer,playerCash+betAmount+betAmount*2)
He used in all setAccountData so why givePlayerMoney? and setAccountData data is saved in account.
-
Try this:
addEventHandler("onPlayerChat", getRootElement(), function(msg, type) if type == 0 then cancelEvent() local r, g, b = getPlayerNametagColor(source) local msg = msg:gsub("#%x%x%x%x%x%x", "") outputChatBox(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x","")..": #FFFFFF"..msg, getRootElement(), r, g, b, true) outputServerLog( "CHAT: " .. name .. ": " .. msg ) end end))
-
Try this:
local g_Vehicle = getPedOccupiedVehicle( localPlayer ) local nitro = tostring(getVehicleNitroLevel(g_Vehicle))
-
Hello,
I created bases and want to teleport to them by a simple command
what can I do ?
teleporting need to be per groups
Thanks!!!
addCommandHandler("go", function (source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Group")) then setElementPosition(x, y, z) else outputChatBox("text...", source, 255, 255, 255, true) end)
-
You first have to get the account with getPlayerAccount. Then use getAccountName to get the account name from the account you got with getPlayerAccount.
You can't use getAccountName with the player element because an account is required in that function.
Where?
-
Just use event parameter for get the account
addEventHandler ("onPlayerLogin", getRootElement(), function ( _, currentAccount ) local account = getAccountName(currentAccount) local searchForAPlayer = executeSQLQuery("SELECT TEST1, TEST2, TEST3 FROM Avengers WHERE Account = ?", account) if #searchForAPlayer == 1 then setElementData(source, "TEST1", searchForAPlayer["TEST1"]) setElementData(source, "TEST2", searchForAPlayer["TEST2"]) setElementData(source, "TEST3", searchForAPlayer["TEST3"]) end end)
i used this too but save or load not work
-
Hello, i tried save and load with executeSQLQuery but idk why not work.
Errors / Warnings:
Warning: Bad argument @ 'getAccountName' [Expected account at argument 1, got player]
Error: Database query failed: no such column: false
addEventHandler("onPlayerQuit", getRootElement(), function () if isGuestAccount(getPlayerAccount(source)) then return end local account = getAccountName(getPlayerAccount(source)) local TEST1 = (getElementData(source, "TEST1") or 0) local TEST2 = (getElementData(source, "TEST2") or 0) local TEST3 = (getElementData(source, "TEST3") or 0) local searchForAPlayer = executeSQLQuery("SELECT TEST1, TEST2, TEST3 FROM Avengers WHERE Account = ?", account) if #searchForAPlayer == 0 then executeSQLQuery("INSERT INTO Avengers (Account, TEST1, TEST2, TEST3) VALUES (?, ?, ?, ?)", account, TEST1, TEST2, TEST13) else executeSQLQuery("UPDATE Avengers SET TEST1 = ?, TEST2 = ?, TEST3 = ? WHERE Account = ?", TEST1, TEST2, TEST3, account) end end) addEventHandler ("onPlayerLogin", getRootElement(), function () local account = getAccountName(source) local searchForAPlayer = executeSQLQuery("SELECT TEST1, TEST2, TEST3 FROM Avengers WHERE Account = ?", account) if #searchForAPlayer == 1 then setElementData(source, "TEST1", searchForAPlayer["TEST1"]) setElementData(source, "TEST2", searchForAPlayer["TEST2"]) setElementData(source, "TEST3", searchForAPlayer["TEST3"]) end end)
-
No you can't if i'am wrong so sorry. But you can use setElementFrozen if not work then idk sorry.
-
Errors/Warnings in /debugscript 3?
-
function whenPlayerChangeNick(_, newNick) local newNick = removeHexColorCode(newNick) local serial = getPlayerSerial(source) local q = dbQuery(database,"SELECT * FROM Nick WHERE Serial = ?", serial) local result = dbPoll(q, -1) if (result) then local actualNicks = poll["Nicks"] if string.find(actualNicks, newNick) then else local addNewNick = actualNicks .. ", " .. newNick dbExec(database, "UPDATE Nick SET Nicks = ? WHERE Serial = ?", addNewNick, serial) end else dbExec(database, "INSERT INTO Nick VALUES(?,?)", addNewNick, serial) end end addEventHandler("onPlayerChangeNick", getRootElement(), whenPlayerChangeNick)
It's fixed.. and poll["Nicks"] ? where is poll?
-
-
-
Hello, can anyone help me why i have this error?
ERROR: attempt to index local 'q' (a userdata value)
function whenPlayerChangeNick(_, newNick) local newNick = removeHexColorCode(newNick) local serial = getPlayerSerial(source) local q = dbQuery(database,"SELECT * FROM Nick WHERE Serial = ?", serial) local poll, rows = dbPoll(q, -1) if (rows == 1) then local actualNicks = q["Nicks"].nicks if string.find(actualNicks, newNick) then else local addNewNick = actualNicks .. ", " .. newNick dbExec(database, "UPDATE Nick SET Nicks = ? WHERE Serial = ?", addNewNick, serial) end end end addEventHandler("onPlayerChangeNick", getRootElement(), whenPlayerChangeNick)
Need Help Remove Nametag
in Scripting
Posted