-
Posts
827 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Cadu12
-
Well, next time, you should write if your isnt FULL code, becuase we can't get know if your code is full. You're welcome
-
Replace 'source' with 'v'. Next time, fix your eyes
-
So, is problem already solved?
-
local _getAccountData = getAccountData local _setAccountData = setAccountData function getAccountData(account, key) local checkifhasjson = false local number = _getAccountData(account, key) if (tonumber(number)) then local json = _getAccountData(account, key .. "0") if (#json ~= 0 and json ~= "") then checkifhasjson = true end end if (checkifhasjson) then local count = _getAccountData(account, key) local jsonstring = "" if (tonumber(count)) then for i = 0, count do local jsonsub = _getAccountData(account, key .. i) jsonstring = jsonstring .. jsonsub end end return fromJSON(jsonstring) else return _getAccountData(account, key) end end function setAccountData(account, key, value) local jsonstring = toJSON(value) if (tostring(key) and tostring(value)) then if (#jsonstring >= 128) then local count = 0 while (true) do _setAccountData(account, key .. count, string.sub(jsonstring, count * 64 + 1, (count + 1) * 64)) if (not (#string.sub(jsonstring, count * 64 + 1, (count + 1) * 64) >= 64)) then break end count = count + 1 end _setAccountData(account, key, count) else _setAccountData(account, key, value) end end end You should use my new function that allowed json without limits.
-
If you are using 'getElementsByType("player")' > Use 'getPlayerAccount(v)' becuase 'v' returns 'player', not 'account' Other problem, about your new function, I can't getting understand what you are talking about. Should be 'gang', and not 'data'?
-
local _getAccountData = getAccountData local _setAccountData = setAccountData function getAccountData(account, key, json) if (not json) then json = false end if (json) then local count = _getAccountData(account, key) local jsonstring = "" if (tonumber(count)) then for i = 1, count do local jsonsub = _getAccountData(account, key + i) jsonstring = jsonstring + jsonsub end end return fromJSON(jsonstring) else return _getAccountData(account, key) end end Try test it, I can't test myself.
-
Do you mean you are making new function for array(toJSON)?
-
Did you made your own new function?
-
There is no need to use getPlayerAccount, just use getAccountData(v, "...")
-
function onPlayerLogin(thePreviousAccount, theCurrentAccount) -- Attempt to load data local theAccountQuery = dbQuery(theHandler, "SELECT * FROM account_stats WHERE player_name='?'", getAccountName(theCurrentAccount)) local theAccountResult = dbPoll(theAccountQuery, -1) if (theAccountResult) then outputChatBox("FOUND ACCOUNT!", source) outputChatBox(theAccountResult[1]['player_name'], source) -- Doesnt Work else outputChatBox("DATA NOT FOUND!", source) end -- Free Query dbFree(theAccountQuery) end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) Should it work, I guess. Not tested yet.
-
Returns the row id if it has been created, false otherwise. Next time, you should read wiki about that function.
-
executeSQLQuery("DELETE * FROM tableName") -- It will delete all rows
-
Line at 109: "getaccountdata" replace with "getAccountData"
-
function ads(player,...) local text = table.concat({...}, " ") if (getPlayerMoney(player) >= 300) then outputChatBox("Advertisment: ".. text .."!", root, 0, 100, 0) takePlayerMoney(player, 300) end end addCommandHandler("ad", ads)
-
Well, I got ideas how to make when I was in bathroom, but I am not going make. Try go in your bathroom and get your some ideas. Read what myonlake said, and I agree.
-
Did you changed to client-side for pickup? You can use setTimer
-
Agree with Solidsnake. Ontopic: Do it own by yourself, these scripts were not made by you, or just ask NexTreme to fix problems. Im not sure, but you can't use these scripts.
-
MTA has own limit. Take a look: http://code.google.com/searchframe#KdIe ... q=&l=10494 Limit: 128
-
Maybe I understand you, are you talking about multi-gamemodes?
-
If am I right, you can use triggerEventClient after loadstring.
-
https://dl.dropbox.com/u/69022807/retard.png He sent me when I was sleeping. For me, that guy isn't great becuase of it.
-
@Anderl: Você está falando que? Aqui em Português, mas tudo bem. I didn't tested what I did rewrite script.