-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Walid
-
-
play[s] = playSound("Sirens/"..s..".wav",true)
-
thePlayer is not defined here
1 hour ago, PyTrO said:setPlayerNametagColor ( thePlayer, r , g , b )
function lol(player) if exports.SAWGacl:isPlayerInGroup(player,"Admin") then local team = getTeamFromName("Admins") if team then setPedSkin(player, 217) setPlayerTeam(player,team) setElementData(player,"class", "Admin") setElementHealth( player, 100 ) setPlayerArmor( player, 100 ) local r, g, b = getTeamColor (team) setPlayerNametagColor (player, r , g , b ) else exports.SAWGcommands:sendMessage("*Commands* You :Oing Moron You're not a sexy HQ Member to use this sexy command.",0,255,0,player) end end end addCommandHandler("A", lol)
-
local play = {} function pSound(key,keyState,s) if play[s] then stopSound(play[s]) else play[s] = playSound("Sirens/"..s..".wav") setSoundVolume(play[s], 0.3) end end bindKey("num_1", "down", pSound,"Sound_003") bindKey("n", "down", pSound,"Sound_012")
-
13 hours ago, pa3ck said:
@Walid That's done using engineImportTXD probably, but even if they are shaders, they are only 1 layered.
@pa3ck check this : CJ sutom clothes
@Dzsozi all what you need: dxCreateTexture,dxCreateShader,dxSetShaderValue,engineApplyShaderToWorldTexture,engineRemoveShaderFromWorldTexture,destroyElement,addPedClothes,removePedClothes, tables (the most important thing).
-
You mean sth like this
-
try to use the customblip resource.
-
3 hours ago, Baseplate said:
I edited the script and made it pass the variables instead of the whole table, works perfectly now.
Nah i don't recommend you to pass variabls one by one, sending the whole table is slightly better (less events triggered) use my code ( getBansTable())
-
Try this
function booleanToString(boolean) return boolean and "true" or "false" end function stringToBoolean(string) return string == "true" and true or false end
-
addCommandHandler("x", function(plr) redirectPlayer(plr, "80.72.41.158", 21000) end )
-
Sorry i can't edit my post, anyways you can use sth like this :
function getBansTable() local bans = getBans() local bansTable = {} for i=1, #bans do local admin = getBanAdmin(bans[i]) or "N/A" local ip = getBanIP(bans[i]) or "N/A" local nick = getBanNick(bans[i]) or "N/A" local serial = getBanSerial (bans[i]) or "N/A" local banTime = getBanTime (bans[i]) or "N/A" local reason = getBanReason (bans[i]) or "N/A" table.insert(bansTable,{admin,ip,nick,serial,banTime,reason}) end return bansTable end function setBans() local bans = getBansTable() if bans then triggerClientEvent(client,"setBans", client, bans) end end addEvent("outputBans", true) addEventHandler("outputBans", resourceRoot, setBans)
-
15 minutes ago, Baseplate said:
I tried that one too before I even posted this topic, doesn't work too.
The getBans() table doesn't pass from the server to client side somehow.
Working fine for me ??
-
Try this
-- Server side function setBans() local bans = getBans() triggerClientEvent(client,"setBans", client, bans) end addEvent("outputBans", true) addEventHandler("outputBans", resourceRoot, setBans) -- Client side function setBans(bans) if bans then for k, v in ipairs(bans) do local row = guiGridListAddRow (stfgrd5) local serial = tostring(v.serial) or "N/A" local duration = tostring(v.time) or "N/A" local ip = tostring(getBanIP(v)) or "N/A" local nick = tostring(getBanNick(v)) or "N/A" local admin = tostring(getBanAdmin(v)) or "N/A" guiGridListSetItemText (stfgrd5, row, 1, serial, false, false) guiGridListSetItemText (stfgrd5, row, 2, duration, false, false) guiGridListSetItemText (stfgrd5, row, 3, ip, false, false) guiGridListSetItemText (stfgrd5, row, 4, name, true, false) guiGridListSetItemText (stfgrd5, row, 5, admin, true, false) end end end addEvent("setBans", true) addEventHandler("setBans", root, setBans) function outputBans() if (source == stfgrd5) then triggerServerEvent("outputBans", resourceRoot) end end addEventHandler("onClientGUIClick", root, outputBans)
-
1 minute ago, MakroBox said:
Oh, thanks!!
And you copied the .fx file from here.Ofc if you want to replace world textures with engineApplyShaderToWaorldTexture you need to use it.
-
1 minute ago, MakroBox said:
Okay... but. Why do I need shader? What it does? Why?
Read this : Shader
-
Just now, MakroBox said:
Do I need? I think I need, beacuse one shader for the first texture and one more shader for the second texture. Or not?
Help me, please!
lol you can use the same shader with multiple textures.
-
51 minutes ago, Noki said:
Discord seems to be the new IRC.
Yeah i like it , guys let's try it Multi Theft Auto server : https://discord.gg/BAUvSrN
- 2
-
21 minutes ago, MakroBox said:
Oh, it's okay, but I only need one fx file? I think I need 2 or more fx file, to change the texture.
I'm leading off the script.Why you need two fx (shader) files ???
-
On 04/11/2016 at 5:25 PM, Lally said:
Is very good! But now the problem is that I bind the j to start the car and gender has no effect if it is broken or not. And if you mess and fix it no longer hurt.
3 minutes ago, Lally said:@Walid Can you help me? You're only helping me
Try to do it by yourself then post your code here.
-
Here is the fx file
//-- Declare the texture. These are set using dxSetShaderValue( shader, "Tex0", texture ) texture Tex0; technique simple { pass P0 { //-- Set up texture stage 0 Texture[0] = Tex0; //-- Leave the rest of the states to the default settings } }
-
3 minutes ago, Stopper said:
Thanks @Walid much better and more organized good job thank you!
You are welcome.
-
Optimized the whole code for you, Fixed some bugs etc ... ( I think you need to release the next version :P)
- Client side
local beepTimer = {} local vehiclesBeep = { [485] = true,[431] = true,[437] = true,[574] = true,[525] = true,[408] = true,[552] = true,[416] = true,[433] = true,[427] = true,[407] = true,[544] = true,[428] = true,[499] = true,[609] = true, [498] = true,[524] = true,[532] = true,[578] = true,[486] = true,[406] = true,[573] = true,[455] = true,[588] = true,[403] = true,[423] = true,[414] = true,[443] = true,[515] = true,[514] = true, [456] = true } function TruckReverseSound(position) local x,y,z = unpack(fromJSON(position)) local sfx = playSound3D("sfx/SFX_REVERSE_BEEP_2.mp3", x, y, z, false) setSoundMaxDistance( sfx, 30 ) end addEvent ( "doReverseBeep", true ) addEventHandler ( "doReverseBeep", root, TruckReverseSound ) function detectDirection () local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle then local matrix = getElementMatrix ( theVehicle ) local velocity = Vector3(getElementVelocity(theVehicle)) local DirectionVector = (velocity.x * matrix[2][1]) + (velocity.y * matrix[2][2]) + (velocity.z * matrix[2][3]) if (DirectionVector < 0) then triggerServerEvent ( "onReverseBeep", resourceRoot,theVehicle) end end end function truckSound(thePlayer, seat) if thePlayer == localPlayer then if(seat == 0) then if eventName =="onClientVehicleEnter" then local model = getElementModel(source) if vehiclesBeep[model] then beepTimer[source] = setTimer ( detectDirection, 1000, 0 ) end elseif eventName =="onClientVehicleExit" then if isTimer(beepTimer[source]) then killTimer (beepTimer[source]) beepTimer[source] = nil end end end end end addEventHandler("onClientVehicleEnter", root,truckSound) addEventHandler("onClientVehicleExit",root,truckSound)
- Server side
function doBeepNextToPlayers (theVehicle) if theVehicle then local vehicleX, vehicleY, vehicleZ = getElementPosition (theVehicle) local position = toJSON({vehicleX, vehicleY, vehicleZ}) triggerClientEvent ( root, "doReverseBeep", root, position) end end addEvent( "onReverseBeep", true ) addEventHandler( "onReverseBeep", resourceRoot, doBeepNextToPlayers )
- 1
-
30 minutes ago, MakroBox said:
Can you send me a script, please, of your idea?
No try to do it by yourself then post your code here. here is an example with the same object ID: 1323
Before (Default texture)
After ( the same object ID with different textures)
- 1
-
I'm not talking about the TXD file, you don't need to replace 192 object , just replace only one object (maybe you need 2 objects depending on the signs ( triangle and circle)) then use: (dxCreateShader, dxCreateTexture, dxSetShaderValue, engineApplyShaderToWorldTexture), to change the signs texture.
I'm pretty sure, you don't undrestand what i'm talking about.
-
@Gravestone use for i=1,x do! (much faster)
function output() for i=1, #playerName do outputChatBox(playerName[i]) outputDebugString( "Working" ) end end addCommandHandler("table2", output)
@External Your code working fine
Call/Exports function
in Scripting
Posted
Then use this server side
And in the dx stuff part just added (onClientRender) event