Close any cheat programs or trainers running. Make sure you check the processes running as the cause of the issue might be a hidden process.
You might want to check this as well: https://wiki.multitheftauto.com/wiki/Anti-cheat_guide
This should work if the row for the account name is `name`:
dbQuery(callback, database, 'SELECT * FROM accounts')
function callback(qh)
local result = dbPoll(qh, 0)
for index, row in pairs(result) do
local account_name = row.name
local player = getAccountPlayer(getAccount(account_name))
if (isElement(player)) then
outputChatBox('Hi', player)
end
end
end
Depends on what identifies them in the table. Since we're talking about accounts, how do you identify a player's account? By knowing that, you can simply retrieve the account from the table, then loop through players trying to find the player with that account. If you're using the default MTA account system, then getAccountPlayer will get you the player with that account. If it's a totally custom accounts system, then only you would know how to get an account's player.
Something like:
dbQuery(callback, database, 'SELECT * FROM accounts')
function callback(qh)
local result = dbPoll(qh, 0)
for index, row in pairs(result) do
local account_name = row.name
-- now find the player with that account name
end
end
If you're MySQL, then I will recommend that onResourceStart, you get all the accounts and store them in a table. That will allow easier and less consuming access.
I don't really get your first question but as for the second, dbQuery(callback, db, 'SELECT * FROM accounts WHERE name = ? LIMIT 1', name) should do. name is the name of the account.
You can use fetchRemote or triggerLatentClientEvent to download files. You can then use fileWrite to save the files.
fetchRemote
triggerLatentClientEvent
fileWrite
Some related resources that you might find helpful:
https://community.multitheftauto.com/index.php?p= ... ls&id=6339
https://community.multitheftauto.com/index.php?p= ... ls&id=7912
There are already a couple of applications that use the API to compile/encrypt the scripts without having to access the webserver:
viewtopic.php?f=140&t=64900
viewtopic.php?f=108&t=64860
You can write a simple system in Lua to compile all the script files using the API:
https://luac.multitheftauto.com/api/
https://wiki.multitheftauto.com/wiki/FetchRemote
I don't think it works anymore, it's badly scripted and it hardly worked before.
I don't have it anymore either. Axel, can you please re-upload it for him? Not on the community though.
Use the findRotation function to make your ped face point2. Also, use setPedControlState to make the ped walk.
You might need to avoid walls and buildings, use isLineOfSightClear for that.
setPedControlState
isLineOfSightClear
findRotation