-
Posts
17 -
Joined
-
Last visited
Everything posted by Ziemo
-
This new function doesn't work, but when I delete: iprint( "qh " .. qh ..", result: ".. result ) from the older code, error doesn't show up EDIT: never mind it showed, I just missed it
-
Hi, I've started writing scripts connected to the database, and I struggle why the current script that I am working on doesn't work. Info: - Name of the table: accounts - Columns: username, skin, money - No errors Here is my script: function showStats(player) local playerName = getPlayerName(player) local qh = dbQuery(db, "SELECT skin, money FROM accounts WHERE username=?", playerName) local result = dbPoll(qh, -1) if result then for _, row in ipairs(result) do outputChatBox("Skin: " ..row["skin"].. "Money: "..row["money"] .. "") end end end addCommandHandler("stats", showStats)
-
It's working, thank you both so much!
-
I changed my code to this: SERVER: local characterName = 'John Doe' triggerClientEvent('showCharacters', root, characterName) CLIENT: function showCharacters(characterName) outputChatBox(characterName, localPlayer) end addEvent('showCharacters', true) addEventHandler('onResourceStart', localPlayer, showCharacters) But it isn't working. I have an error: Server triggered clientside event showCharacters, but event is not added clientside.
-
I think it will work, but I want to make the opposite thing, pass a variable from server to client.
-
so this variable in client script should look like this? characterName = triggerServerEvent('getCharacterName', localPlayer, characterName)
-
so client variable should look like this? characterName = triggerServerEvent('getCharacterName', localPlayer, characterName)
-
So how can i make a function that calls server-side variable?
-
But it won't open up the whole gui. I want to open this gui after successful client login.
-
Hi, I have a little problem with my script. I wanted to use server variable in client-side script, so I used trigger server and client event, but unfortunately, it didn't work. Do you know why? PS: This script has to display variable characterName in grid row. SERVER SIDE SCRIPT: function getCharacterName(characterName) local characterName = 'James' triggerClientEvent ( thePlayer, 'getCharName', thePlayer, characterName ) end addEvent('getCharacterName', true) addEventHandler('getCharacterName', root, getCharacterName) CLIENT-SIDE SCRIPT: function openCharacterMenu(characterName) menu = guiCreateWindow(0.5, 0.5, 0.2, 0.25, 'Characters', true) charactersList = guiCreateGridList(0.5, 0.5, 0.4, 0.6, true, menu) charactersColumn = guiGridListAddColumn(charactersList, 'Characters', 0.6) charactersRow = guiGridListAddRow(charactersList, 'No characters found') guiGridListSetItemText(charactersList, charactersColumn, charactersRow, characterName, false, false) end addEvent('getCharName', true) addEventHandler('login.success', localPlayer, openCharacterMenu) I see one error in client debug: Bad argument @ 'gu'iGridListSetItemText [expected string at argument 4 got, nil] Event 'login.success' opens up characters gui
-
Hello everyone, i wanted to make custom texures (vinyls) for vehs on my mta server. I wanted it to look like this: The main function of this script should be putting textures on every part of my car. I don't want to replace txd, because I want to replace only one car at once. The main problem is, I have no idea how to make this kind of script. Does anyone in here knows how to write this kind of script? PS: I want to make this as simple as possible.
-
Hello, I wanned to add vehicle variant, but I have no idea how to do this. I already read MTA wiki, but it still doesn't work.
-
Hi , i made a map for my server and when i try to load it's nothing happend and in console i see that this map is not compatible with 'play'. What i can do to run my map?