-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
(take/give)PlayerMoney when used client side, won't really give/take anything from the player, since the money won't be synchronized with the server. You should do the withdraw/deposit parts server-side.
-
How are you "depositing" the money? can you post the bank deposit code?
-
Try this. addEventHandler("onPlayerLogin", getRootElement(), function () local account = getPlayerAccount(source) local balance = (getAccountData(account, "bankmoney") or 0) if balance then setAccountData(account, "bankmoney", balance) else setAccountData(account, "bankmoney", 0) end end ) addEventHandler("onPlayerLogout", getRootElement(), function () local account = getPlayerAccount(source) local balance = (getAccountData(account, "bankmoney") or 0) setAccountData(account, "bankmoney", balance) end ) addEventHandler("onPlayerQuit", getRootElement(), function () local account = getPlayerAccount(source) local balance = (getAccountData(account, "bankmoney") setAccountData(account, "bankmoney", balance) end ); Your code doesn't make any sense, you are basically obtaining the bank, then setting it back? how does that make sense? @Best-Killer: Are you trying to save the money players have?
-
Use dbExec for insert/update queries.
-
dbExec( connection, "UPDATE `??` SET `??`=? WHERE username = ?", tableName, columnName, columnValue, username )
-
No dije que hicieras nada, solo corregi a alex y tomas.
-
Well, you can always sync the time left using element data.
-
"return" va despues de tu codigo, osea despues de outputChatBox. @Tomas: Eso no funcionara, porque el quiere evitar que usen algunos signos en los nombres de usuario. Imaginate que el usuario fuese: "$Hello$", tu codigo no lo detectaria, ya que solo detectaria si es "$", "%", etc.
-
I don't recommend creating the timers on the server side, I would do it client side instead, and then you can draw the remaining time using DX functions.
-
We can't help you if you don't post the buy map code from the userpanel script.
-
That'll cause a infinite loop, since you named your new function like the native MTA function.
-
setWeaponProperty will change the properties for all the players in the server, which means that if you change the silenced pistol damage, it'll be for everyone.
-
Cancel the original damage ( onClientPlayerDamage + cancelEvent ) and use setElementHealth.
-
You can't change weapon properties individually for each player.
-
function indulas ( ) moveObject(hajo, 15000, 405.10000610352, -2230.3000488281, 17.200000762939) -- when reach this position then make a 180 turn and come back to the starting position. setTimer ( moveObject, 15100, 1, hajo, 15000, x, y, z ) end
-
Use a timer to move the object back.
-
El evento que estas usando se ejecuta por la funcion "setRadioChannel", por lo que es un loop infinito. Quita setRadioChannel.
-
Si lo unico que hiciste fue un mapa, entonces lo hubieras subido como mapa. Lo que hiciste fue tomar el script de otra persona, borrarle sus creditos y subirlo como tuyo, eso es robar. El recurso fue removido.
-
You can't change the stats of the ped for the simple reason that the ped is created client-side, so the server is not aware of it.
-
That function should execute the same action as "refresh" command.
-
I have used the "refresh" function on my server with at least 350 players online and it never "lagged".
-
This script is mine, if you download it, you'll see that it still has the copyright in the files. Links removed. I've also removed all your other topics, because I'm quite sure you don't own ANY of them, you're just trying to make profit out of other people's work.
-
You have to use guiGridListSetSelectionMode. I've redesigned your table, it's easier to edit this way. By the way, I created a grid list for testing, it's part of the code, you should remove it and apply the selection mode to your grid list. local wepsTbl = { { category = "Handguns", weapons = { { name = "Deagle", id = 24 }, { name = "Pistol", id = 22 }, { name = "Silenced", id = 23 } } }, { category = "Shotguns", weapons = { { name = "Shotgun", id = 25 }, { name = "Spaz-12", id = 27 }, { name = "Sawed-off", id = 26 } } }, { category = "SMG", weapons = { { name = "Uzi", id = 28 }, { name = "Tec-9", id = 32 }, { name = "MP5", id = 29 } } }, { category = "Assault Rifles", weapons = { { name = "M4", id = 31 }, { name = "AK47", id = 30 } } }, { category = "Rifles", weapons = { { name = "Country Rifle", id = 33 }, { name = "Sniper Rifle", id = 34 } } }, { category = "Heavy", weapons = { { name = "RPG", id = 35 }, { name = "Heat-Seeking RPG", id = 36 }, { name = "Flamethrower", id = 37 }, { name = "Minigun", id = 38 } } }, { category = "Melee", weapons = { { name = "Purple Dildo", id = 10 }, { name = "Short Dildo", id = 11 }, { name = "Vibrator", id = 12 }, { name = "Flowers", id = 14 }, { name = "Cane", id = 15 }, { name = "Golf Club", id = 2 }, { name = "Nightstick", id = 3 }, { name = "Knife", id = 4 }, { name = "Baseball Bat", id = 5 }, { name = "Shovel", id = 6 }, { name = "Pool Cue", id = 7 }, { name = "Katana", id = 8 }, { name = "Chainsaw", id = 9 } } } } wepGrid = guiCreateGridList(0.32, 0.25, 0.30, 0.27, true) -- TEST GRID LIST guiGridListSetSelectionMode ( wepGrid, 2 ) for _, data in ipairs ( wepsTbl ) do local column = guiGridListAddColumn ( wepGrid, data.category, 0 ) for index, weapon in ipairs ( data.weapons ) do guiGridListAddRow ( wepGrid ) guiGridListSetItemText ( wepGrid, index, column, weapon.name, false, false ) guiGridListSetItemData ( wepGrid, index, column, weapon.id ) end guiGridListAutoSizeColumn ( wepGrid, column ) end
-
You can't change GUI label scale.
-
Define the column ID for each category, then add the rows to only that category.