
Karuzo
Members-
Posts
1,213 -
Joined
-
Last visited
Everything posted by Karuzo
-
Exactly. As you can see here:
-
Yeah im triggering the local player.
-
Yeah they were showing. That's why im confused.
-
Hey Community, i have a problem with setting element data to the player. Here's my code: function login_func ( player, username, password) local query = dbQuery ( connect, "SELECT username, password FROM accounts WHERE username = ?", username ) if ( query ) then local data, rows = dbPoll ( query, -1 ) if ( rows >= 1 ) then if ( data [ 1 ].password == password ) then local elementdata = setElementData(player, "LoggedIN",true) outputChatBox(tostring(elementdata)) outputChatBox("Du hast dich erfolgreich eingeloggt!",player,0,125,0) outputChatBox("Willkommen zurück, "..string.gsub ( getPlayerName ( player ), '#%x%x%x%x%x%x', '' ),player,0,125,0) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("Error 404 : Dein Benutzername oder dein Passwort ist falsch!",player,125,0,0) end end end end So what is my problem ? I'm trying to set the element data to the player that he is LoggedIn. But if i wanna output the data it says false. Why ?
-
So theres no way to do with GUIs ? If so , how would such an DX Editbox be created ?
-
I still need help with this. What i actually want to make is : A login Panel with a editbox where the editbox' alpha is down to 0 but the text will be still visible.
-
Works perfectly! I think i have it now! Thank you all for your effort and your help!
-
And where should i use that ?
-
I mean , if he clicks on another car, the car which he first clicked stays there. I mean clear and load it again, wouldn't that lag ?
-
Oh works now. But it stays always the car which i've chosen first. How can i update it ? function ShowAutos() local row = guiGridListGetSelectedItem( vehicleList ) local carget = guiGridListGetItemText( vehicleList, row, 1 ) local carput = getVehicleModelFromName(carget) outputChatBox(carget) if not isElement( carshow ) then carshow = createVehicle( carput,544.74103, -1298.83533, 32.54056 ) end renderCameraRotation ( carshow, 544.74103, -1298.83533, 32.54056 ) end
-
Ok so Jesseunit helped me very well with the Camera thing. So with the Car: I tried to put a outputChatBox so i can test if he gets the car. But he outputs Nothing. So he doesn't get the Car. And the gridlist would be probably the problem. I dunno what the problem with the gridlist could be. But i hope you could help me . @Citizen: I tried it with tonumber but it outputs "nil". Code : function showList() local table = {} vehicleList = guiCreateGridList(14, 30, 200, 367, false, Carwnd) vehicleList1 = guiGridListAddColumn( vehicleList, "Fahrzeug", 0.5 ) priceList = guiGridListAddColumn( vehicleList, "Preis", 0.3 ) node = xmlLoadFile("data/vehicles.xml") if ( node ) then local vNum = 0 while ( xmlFindChild ( node, "group", vNum ) ~= false ) do local group = xmlFindChild ( node, "group", vNum ) local gName = xmlNodeGetAttribute ( group, "id" ) guiGridListSetItemText( vehicleList, guiGridListAddRow ( vehicleList ), 1, ""..gName.."", false, false ) local vNum1 = 0 while ( xmlFindChild ( group, "vehicle", vNum1 ) ~= false ) do local aVehicle = xmlFindChild ( group, "vehicle", vNum1 ) local vId = xmlNodeGetAttribute ( aVehicle, "id" ) local vName = getVehicleNameFromModel ( vId ) local vPreis = xmlNodeGetAttribute ( aVehicle, "price" ) local row = guiGridListAddRow ( vehicleList ) guiGridListSetItemText( vehicleList, row, 1, ""..vName.."", false, false ) guiGridListSetItemText( vehicleList, row, 2, ""..vPreis.."", false, false ) vNum1 = vNum1 + 1 end vNum = vNum + 1 end xmlUnloadFile ( node ) end return table end function ShowAutos() local row = guiGridListGetSelectedItem( vehicleList ) local carget = guiGridListGetItemText( vehicleList, row, 1 ) outputChatBox(carget) if not isElement( carshow ) then carshow = createVehicle( carget,544.74103, -1298.83533, 32.54056 ) end renderCameraRotation ( carshow, 544.74103, -1298.83533, 32.54056 ) end
-
Just tested it. The Camera freaks out and there's still no car.
-
I don't understand what you mean
-
Works now , but the car isn't created. Do i have to update it or smth like that ? i don't think so cause onClientRender would get the Selected Item every frame right ? function ShowAutos() local row = guiGridListGetSelectedItem(vehicleList) local carget = guiGridListGetItemText(vehicleList, row, 1) local carshow = createVehicle(carget,544.74103, -1298.83533, 32.54056) renderCameraRotation( carshow,544.74103, -1298.83533, 32.54056 ) end
-
Yeah got it. But now it gives me an awkward error. Code: local angle = 0 function renderCameraRotation( target, targetX, targetY, targetZ, cameraHeight, radius, speed, roll, fov ) local target = target or nil local cameraHeight = cameraHeight or 5 local radius = radius or 20 local speed = speed or 1 local roll = roll or 0 local fov = fov or 70 if isElement( target ) then targetX, targetY, targetZ = getElementPosition( target ) end local camX = targetX + radius * math.cos( math.rad( angle ) )--This line. local camY = targetY + radius * math.sin( math.rad( angle ) ) if ( angle <= 360 ) then angle = angle + speed else angle = 0 end setCameraMatrix( camX, camY, targetZ + cameraHeight, targetX, targetY, targetZ, roll, fov ) end
-
Why doesn't this work ? function ShowAutos() local car = guiGridListGetItemText ( vehicleList, guiGridListGetSelectedItem ( vehicleList ), 1 ) local carshow = createVehicle(car,544.74103, -1298.83533, 32.54056) renderCameraRotation( carshow ) end im adding the EventHandler onClientMarkerHit.
-
Yeah i know that part, but how can i get the selected item ?
-
Thanks, and lets say i have GUI with a Gridlist which contains a few Vehicles. How can i make it that if he clicks e.g.: on Infernus it will show an Infernus and rotate it ?
-
Wow! Thank you all for your help! I think i'm gonna use Jesseunit's code
-
Yeah, a friend helped me out: local account = getAccountName(getPlayerAccount(player)) local checkcar = dbQuery(connection,"SELECT * FROM car WHERE owner='"..account.."'") local result = dbPoll(checkcar,-1) if #result >= 1 then outputChatBox("Du hast bereits ein Auto!",player, 125,0,0,false) --... Thank you anyway Citizen
-
Ok, so i tried that with the IDs, but i get always an error. bad argument #1 to 'ipairs' (table expected, got userdata) dunno why. local ID = dbQuery(connection,"SELECT id FROM car") for i,v in ipairs(ID) do carid = v.id+1 end and than i just INSERT that carid in the id column.
-
Well yeah that's what i mean. Just rotate them with setElementRotation ? I think i need a loop or smth like that. How would that loop go ?
-
Yo, How can i create a Camera-Matrix which looks 360° all the time of a skin/car ? Like in a Skin-Selection or smth like that. Hope you understand what i mean Regards, KRZO.
-
@Citizen: What would be index_name ? I mean lets say i INSERT INTO the owner column a owner, and i had a index on that column, and the owner has already a car. Would that interrupt the INSERT and would do nothing ? And how is that with dbPoll? I'm pretty new to SQL.