-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
That's because "carID" returns a string, you must convert it to number using tonumber. Also, what's the point of the loop? you can just do: if ( carsTable [ tonumber ( carID ) ] ) then end
-
local theSerial = "0396C6F543425FFE37A326883D73B4F4" local vehicleTimer = { } local isEnabled = { } addCommandHandler ( "colors", function ( thePlayer, command ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then local v = getPedOccupiedVehicle ( thePlayer ) if ( not isEnabled [ thePlayer ] ) then isEnabled [ thePlayer ] = true else isEnabled [ thePlayer ] = false end if ( isEnabled [ thePlayer ] and v ) then if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end vehicleTimer [ thePlayer ] = setTimer ( randomVehColors, 2000, 0, thePlayer ) end end end ) addEventHandler ( "onVehicleEnter", getRootElement(), function ( thePlayer ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then if ( isEnabled [ thePlayer ] ) then local v = getPedOccupiedVehicle ( thePlayer ) if ( v ) then if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end vehicleTimer [ thePlayer ] = setTimer ( randomVehColors, 2000, 0, thePlayer ) end end end end ) addEventHandler ( "onVehicleStartExit", root, function ( thePlayer ) if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end end ) function randomVehColors ( thePlayer ) local car = getPedOccupiedVehicle( thePlayer ) if ( not car ) then if ( isTimer ( vehicleTimer [ thePlayer] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end return end if ( isVehicleDamageProof ( car ) == true ) then local c1 = math.random ( 0, 126 ) local c2 = math.random ( 0, 126 ) local c3 = math.random ( 0, 126 ) local c4 = math.random ( 0, 126 ) setVehicleColor ( car, c1, c2, c3, c4 ) end end
-
You want to know what each line does? texShader = dxCreateShader ( "shader/texreplace.fx" ) -- Creates a shader element vehiclelights128 = dxCreateTexture("img/generic/vehiclelights128.png") -- Creates a texture element vehiclelightson128 = dxCreateTexture("generic/vehiclelightson128.png") -- Creates a texture element dxSetShaderValue(texShader,"gTexture",vehiclelights128) -- Sets the value of a shader element engineApplyShaderToWorldTexture(texShader,"vehiclelights128") -- Applies a shader to one or more world textures. dxSetShaderValue(texShader,"gTexture",vehiclelightson128) -- Sets the value of a shader element engineApplyShaderToWorldTexture(texShader,"vehiclelightson128") -- Applies a shader to one or more world textures.
-
That should work, have you refreshed the resources list?
-
You should use the event: "onClientGUIAccepted". GUIEditor = { gridlist = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(284, 101, 730, 555, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(11, 21, 709, 480, false, GUIEditor.window[1]) col = guiGridListAddColumn(GUIEditor.gridlist[1], "Support", 0.9) GUIEditor.edit[1] = guiCreateEdit(9, 504, 705, 41, "", false, GUIEditor.window[1]) addEventHandler ( "onClientGUIAccepted", GUIEditor.edit[1], updateGridList, false ) guiSetVisible ( GUIEditor.window[1] ,false ) end ) bindKey ( "J" , "down", function ( ) local state = ( not guiGetVisible ( GUIEditor.window[1] ) ) guiSetVisible ( GUIEditor.window[1], state ) showCursor ( state ) end ) function updateGridList ( ) local Text = guiGetText ( GUIEditor.edit[1] ) if ( Text ~= "" ) then local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, col, Text, false, false ) end end
-
Take an screenshot of how you put it into the resources folder.
-
"thePlayer" is not defined.
-
Did you install the resource correctly?
-
function PlayerJoin ( ) local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, col, getPlayerName ( source ), false, false ) end addEventHandler ( "onClientPlayerJoin", getRootElement(), PlayerJoin ) function PlayerQuit ( ) for row = 0, guiGridListGetRowCount ( GUIEditor.gridlist[1] ) do if ( guiGridListGetItemText ( GUIEditor.gridlist[1], row, col ) == getPlayerName ( source ) ) then guiGridListRemoveRow ( GUIEditor.gridlist[1], row ) break end end end addEventHandler ( "onClientPlayerQuit", getRootElement(), PlayerQuit )
-
Si no me equivoco, tenes que poner vos el trafico con ese recurso.
-
You're welcome.
-
Well, if you make it client side, nobody will see it but the one that used the command.
-
Slothbot must have a bug then.
-
function ficar ( ) exports.slothbot:setBotWait(tigre1) local mode = exports.slothbot:getBotMode ( tigre1 ) if ( mode ) then outputChatBox ( mode ) end exports.slothbot:setBotWait(pantera1) exports.slothbot:setBotWait(cachorro1) exports.slothbot:setBotWait(lobo1) exports.slothbot:setBotWait(raposa1) exports.slothbot:setBotWait(cachorro2) exports.slothbot:setBotWait(pitbull1) exports.slothbot:setBotWait(pitbull2) end addCommandHandler ( "stay", ficar ) Use that and see waht it outputs.
-
This is a server side script? if so, then "localPlayer" should be "thePlayer". function attach ( thePlayer ) local v = getPedOccupiedVehicle ( thePlayer ); local x, y, z = getElementPosition ( thePlayer ); local theTrailer = createVehicle ( 450, x, y, z+15 ); --+15 attachTrailerToVehicle ( v, theTrailer ); end addCommandHandler ( "attc", attach )
-
After you set the bot to wait, what does getBotMode return?
-
I'll have to ask you both to stay on topic.
-
Rotation arguments are optional, I don't see why it would say that.
-
For the first thing, you must use the resoruce "zombies" and change the spawn method to spawnpoints, then you just place the spawnpoints, and for the second thing, you can search on the community for a script, there are some.
-
Go ingame and write "/start ".