-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I don't understand what do you mean, please explain yourself better.
-
What do you mean by that? the HUD only appears when you have activated the nitro of the vehicle?
-
That's because the function bindKey when used server-side, it requires a player element, and 'playerSource' is obviously nil in your script. addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "m", "down", showArrest ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "m", "down", showArrest ) end ) function showArrest ( playerSource ) local playeraccount = getPlayerAccount ( playerSource ) local arrest = getAccountData ( playeraccount, "arrest" ) if ( not arrest ) then outputChatBox ( "you dont have any arrest", playerSource ) else outputChatBox ( "arrest: ".. arrest, playerSource ) local accountN = getAccountName ( playeraccount ) triggerClientEvent ( playerSource, "onArrestRequest", playerSource, arrest, accountN ) end end addCommandHandler ( "arrest", showArrest ) As you can see, I binded the key when the player joins and when the resource starts ( to bind it for everyone ). Also, "playeraccount" was not defined, you had to get the account with getPlayerAccount.
-
warpPedIntoVehicle is not required, that function is used to warp a player/ped into a vehicle, not change the position of it. addEventHandler ( "onClientGUIClick", root, function ( ) local sel = guiGridListGetSelectedItem ( grid ) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( source == move ) then if ( sel ~= -1 ) then local theElement = ( theVehicle and theVehicle or localPlayer ) local x, y, z = unpack ( guiGridListGetItemData ( grid, sel, 1 ) ) fadeCamera ( false, 0.5 ) fadeCamera ( true, 2 ) setElementPosition ( theElement, x, y, z ) else outputChatBox ( "* Please Select A Positon", 255, 0, 0 ) end end end ) That should change the position of the vehicle ( if he/she is in one ) and the localPlayer ( if not in a vehicle ).
-
he got a local on that already so.. dxDrawText ( "#0080FFNitro: [size=6][b]..hColor..[/b][/size]".. ( type ( fNitroLevel ) == "number" and fNitroLevel .."#0080FF%" or "No nitro" ), (rx - 199 ), ( ry - 29), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1, "default-bold", "left", "top", false, false, true, true, false ) Yeah, but that'll use the same color as the health bar, it won't matter if the nitro goes down, it'll use the health value to set the color.
-
That's not what he wants, he wants to change the color of the text.
-
local rx, ry = guiGetScreenSize ( ) function vehiclestatus ( ) if ( isPedInVehicle ( localPlayer ) == false ) then return false end local x, y, z = getElementPosition( localPlayer ) local car = getPedOccupiedVehicle ( localPlayer ) local sx, sy, sz = getElementVelocity ( car ) local kphSpeed = math.ceil( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) local mphSpeed = math.ceil( ( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) / 1.61 ) local health = getElementHealth ( car ) local name = getVehicleName ( car ) local currenthealth = math.floor( health/10 ) local fNitroLevel = getVehicleNitroLevel ( car ) if ( type ( fNitroLevel ) == "number" ) then fNitroLevel = math.floor ( ( fNitroLevel * 100 ) ) end local hColor = "#00ff00" -- Health Colors -- if ( currenthealth < 20 ) then hColor = "#ff0000" elseif ( currenthealth < 40 ) then hColor = "#FF6400" elseif ( currenthealth < 60 ) then hColor = "#C86400" elseif ( currenthealth < 70 ) then hColor = "#C89600" elseif ( currenthealth < 80 ) then hColor = "#329600" elseif ( currenthealth < 90 ) then hColor = "#00ff00" end dxDrawRectangle( ( rx-205 ), ( ry-78 ), 199, 17, tocolor(0, 0, 0, 180), true) dxDrawRectangle( ( rx-205 ), ( ry-54 ), 199, 17, tocolor(0, 0, 0, 180), true) dxDrawRectangle( ( rx-205 ), ( ry-30 ), 199, 17, tocolor(0, 0, 0, 180), true) dxDrawText ( "#0080FFVelocidad: #FFFFFF"..tostring(kphSpeed).." #FF8000Kmh #0080FF/ #FFFFFF"..tostring(mphSpeed).." #FF8000Mph", ( rx - 199 ), ( ry - 77 ), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1,"default-bold", "left", "top", false, false, true, true, false ) dxDrawText ( "#0080FFVehiculo: #FFFFFF".. hColor ..""..tostring(currenthealth).."#0080FF% #FF8000| #0080FF"..tostring(name).."", ( rx - 199 ), ( ry - 53 ), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1,"default-bold", "left", "top", false, false, true, true, false ) dxDrawText ( "#0080FFNitro: #FF8000".. ( type ( fNitroLevel ) == "number" and fNitroLevel .."#0080FF%" or "No nitro" ), (rx - 199 ), ( ry - 29), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1, "default-bold", "left", "top", false, false, true, true, false ) end addEventHandler ( "onClientRender", root, vehiclestatus )
-
What do you mean by change the word "false"?
-
local disabledCmds = { [ "me" ] = true, [ "pm" ] = true } addEventHandler ( "onPlayerCommand", root, function ( cmd ) if disabledCmds [ cmd ] then if isPlayerMuted ( source ) then outputChatBox ( "[AntiSpam]: ".. getPlayerName ( source ) .." was kicked for trying to change his nick while muted!", root, 0, 175 ,255 ) kickPlayer ( source, "AntiSpam: Dont try to use commands while muted!" ) end end end )
-
Tenes que usar una tabla.
-
Tenes que guardar ese vehiculo en algun lugar para luego destruirlo.
-
What are you trying to do exactly?
-
Usa el evento: onVehicleExit con la funcion: destroyElement.
-
Podes usar la funcion getVehicleNitroLevel que fue añadida hace poco.
-
But it is optional, as far as I know, you don't have to compile them, you can leave them uncompiled.
-
Well, for what I understood of the first one, is that he wants that only the hoster can save the map while editing.
-
1. I don't get it. 2. What do you mean by "easy"? it is already easy enough to do it.
-
No, el problema es que estas usando un argumento que no existe, no enviaste ningun argumento desde el client side, osea que tenes que usar "source" como jugador. addEvent ( "pasar", true ) addEventHandler ( "pasar", getRootElement(), function ( vehicle ) if ( getElementDimension ( source ) == 10 ) and ( getElementInterior ( source ) == 0 ) and ( getElementModel ( vehicle ) == 410 ) then destroyElement ( vehicle ) showPlayerHudComponent ( source, "ammo", true ) showPlayerHudComponent ( source, "area_name", true ) showPlayerHudComponent ( source, "armour", true ) showPlayerHudComponent ( source, "breath", true ) showPlayerHudComponent ( source, "clock", true ) showPlayerHudComponent ( source, "health", true ) showPlayerHudComponent ( source, "money", true ) showPlayerHudComponent ( source, "radar", true ) showPlayerHudComponent ( source, "vehicle_name", true ) showPlayerHudComponent ( source, "weapon", true ) setElementDimension ( source, 0 ) givePlayerMoney ( source, 500 ) --- Dinero setElementModel ( source, 188 ) --- Skin setTimer ( setElementInterior, 500, 1, source, 0 ) setTimer ( setElementPosition, 1500, 1, source, -2489.859,2510.48,18.091 ) setTimer ( setPedRotation, 0, 1, source, 0 ) outputChatBox ( "La prueba ha terminado", source, 255, 0, 0, false ) end end ) Igual asi, no funcionara, porque "vehicle" no esta siendo enviado desde el client side.