djharbi2
-
Posts
80 -
Joined
-
Last visited
Posts posted by djharbi2
-
-
Hi,
the player I chose, i want him to follow meI mean, wherever I go it will come automatically, when I get in the car, it will also get on my car. When I get off, it will go down.
Thank you in advance for your help.
-
2 hours ago, The_GTA said:
Hello djharbi2,
did you know that you can use shaders to replace ingame textures? With shaders you can write text into a DX render-target and then attach it to a shader that would replace your license plate texture! With this technique you can create a custom license plate GUI like in your picture above. Here are some hints to lead you in the right direction:
- dxCreateRenderTarget - create the dynamic texture where you can draw text on
- dxDrawText - draw your own text onto the license plate
- dxDrawRectangle - you can fill that blue color on the left side with this function
- dxCreateShader - you have to create a shader that would replace the license plate texture of your vehicle
- dxSetShaderValue - function to attach your render-target with custom text to the license plate shader
- engineApplyShaderToWorldTexture - to attach your shader to the vehicle texture
Have you already looked at the resource community for sample scripts? It is always a good idea to learn from already existing code
- customvehplate - seems to do what you want; you just have to adjust it to fit your style + extend for GUI!
Feel free to post any questions.
- Martin
Thank you for your answer, this adds pictures on the existing plate. but I want to add a picture separately. Think like a sticker.
-
Hi,
creating a new plate
I want users to create a new plate using the pictures below, how can I do?example:
-
thanks bro, problem solved
-
If you recreate the above code, I would be glad, you can do it
-
problem persists
-
yes that's exactly the problem
-
want to pull the vehicleHP value of the matching person
For example:
djharbi, 520, infernus, 100, good,1000 (This is a sample data)
The data I want > 1000 (vehicleHP)
-
no help, I think
-
Hi, I want to print the matching value but I can't
Can you help, thank you ...
server.Lua
local vehDB = dbConnect( 'sqlite', 'vehicle.db' ) dbExec(vehDB,' CREATE TABLE IF NOT EXISTS `vehicle_base` (pAcc, vehicleID, vehicleName, vehiclePrice, vehicleStatus, vehicleHP)') function dategetV() local results = dbPoll(dbQuery(vehDB, "SELECT * FROM `vehicle_base` WHERE vehicleID=? AND pAcc=?",520,getAccountName(getPlayerAccount(source))), -1) if results then for k,v in ipairs ( results ) do outputDebugString(tostring(v['vehicleHP'])) end end end addEvent("dategetV", true) addEventHandler("dategetV", getRootElement(getThisResource()), dategetV)
-
Hi, dxCreateTexture How do I round an image created with
myImage = dxCreateTexture( "moonpig.png" ) dxDrawImage( 100, 350, 300, 350, myImage )
-
hello what were the best mtaserver.conf file settings
ie I want a mtaserver.conf file with settings made in the best settings
Thank you from now
-
5 minutes ago, stPatrick said:
Try, like this:
dbExec(b_data, "INSERT INTO bank (bank_username,bank_pass,bank_ques,bank_answ,bank_money) VALUES (?,?,?,?,?)", b_username, b_pass, b_ques, b_answ, b_money)
problem persists
-
Does anyone know the problem?
-
3 minutes ago, salh said:
where is b_date?
I didn't write it here, it normally exists
-
Hi, saving datebase. But does not record the question properly
entered: your favorite writer?
saved: your favorite writer'(? instead ' is happening)
database charset: utf-8
how can I solve this problem?
local username = "root" local password = "123456" local b_data = dbConnect("mysql","dbname=mtaserver;host=localhost;charset=utf8;port=3311", username, password, "autoreconnect=1"), local b_username = "admin" local b_pass = "1234" local b_ques = "your favorite writer?" local b_answ = "T. Well" local b_money = "0" local bank = dbExec(b_data, "INSERT INTO bank (bank_username,bank_pass,bank_ques,bank_answ,bank_money) VALUES('"..b_username.."','"..b_pass.."','"..b_ques.."','"..b_answ.."','"..b_money.."')")
-
Hi,
mysql connection falls after some time
databasen = setting.mysql function chac1() local acc = getPlayerAccount (client) local username = getAccountName ( acc ) local slot = getAccountData (acc,"characterslot") or "no" local veriable2s = mysql_query(databasen, "SELECT * FROM skinshop WHERE skinshop_username='"..username.."'") if veriable2s then local okey2 = mysql_fetch_assoc(veriable2s) for okey,row in mysql_rows(veriable2s) do c1 = row[3] c2 = row[4] end end mysql_free_result(veriable2s) end
the first time it works, there is no problem, but then disconnects the database
How can I solve
-
9 hours ago, Tails said:
Make sure you put lang.lua before client.lua in the meta file so it loads first.
Thank bro.
-
Hi,
lang.lua
fr = { a1 = "sortie", } eng = { a1 = "Exit", }
client.lua
guiSetText(lbl,""..eng.a1)
Error: attempt to index global 'eng' (a nil value)
how can i call?
-
5 minutes ago, SaNoR said:
Thank you bro
-
this is loginpanel file
login= guiCreateStaticImage(x,y,width, height,"../file/bg.png",false)
I want to get here > file script
two separate script
how can I do it??
-
8 hours ago, Keiichi1 said:
Client:
local sx, sy = guiGetScreenSize() function renderText() dxDrawText(timeText, sx/2, sy/2, 0, 0, tocolor(255, 255, 255), 2, "default-bold") end function updateTime() if isTimer(timer) then timeText = formatTime(getTimerDetails(timer)) end end addCommandHandler("timer", function(cmd, min) if tonumber(min) then if not isTimer(timer) then local time = tonumber(min) * 60000 timer = setTimer(function() removeEventHandler("onClientRender", getRootElement(), renderText) end, time, 1) setTimer(updateTime, 1000, 0) timeText = formatTime(getTimerDetails(timer)) addEventHandler("onClientRender", getRootElement(), renderText) end else outputChatBox("SYNTAX: /timer [minutes]") end end) function formatTime(ms) local totalseconds = math.floor(ms / 1000) local ms = ms % 1000 local seconds = totalseconds % 60 local minutes = math.floor(totalseconds / 60) % 60 return string.format("%02d:%02d", minutes, seconds) end
thanks bro
-
1 minute ago, ViRuZGamiing said:
Just create a variable that represents the timer in seconds (since thats the smallest time you'd want to show) so if you'd want a timer of 10 min you'd have:
timer = 600
You'd draw that timer variable as a dxtext on render and decrement the timer by 1. You'd want to convert the 600s to min and seconds tho but thats just some simple math.
do you make an example
-
eg countdown from 10 minutes
10:00 > 09:59 > 09:58 .....
[Help] player to follow me
in Scripting
Posted
thank you