-
Posts
269 -
Joined
-
Last visited
Everything posted by fairyoggy
-
@Bartje I think it can help, but I don’t understand how to fix it. addCommandHandler("wv", function(player, cmd) local element = "vehicle" local radius = 3 local x, y, z = getElementPosition(player) local colshape = createColSphere(tonumber(x), tonumber(y), tonumber(z), tonumber(radius)) for index, value in ipairs(getElementsWithinColShape(colshape, element)) do setVehicleLocked ( element, true ) outputChatBox("lock", player, 220, 220, 0) end end)
-
How can I interact with nearby vehicles? For example, a car is standing in front of me and I want to close or open door, namely it. How can I do it?
-
I did through onPlayerVehicleEnter . When a player gets into the car at night, the headlights turn on for a split second, and after turn off. I would like that when the player got into the car of this inclusion for a split second did not happen The player got into the vehicle and the headlights were initially turned off and did not turn on
-
Can I turn off the automatic inclusion of headlights at night? Even if I use the command setVehicleLightState the car still turns on the lights for a split second and then turn off even if I indicated that they are off. I mean, there should be no headlights on for a split second. need just force off
-
As far as I understand, my function cannot find a car when i go out of it. How do I find him? function removeHelmetOnExit ( vehicle, seat, jacked ) local myCar = getPedOccupiedVehicle(source) local engine = getVehicleEngineState (myCar) if engine then setElementData(myCar,"engine",1) elseif not engine then setElementData(myCar,"engine",0) end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit )
-
Now everything works as it should. You helped me a lot, thank you very much!
-
Now I don’t know what’s the matter. Nothing happens on command, writes nothing in debug
-
Now it works as intended, but is it possible to implement the call of this command on the client?
-
If do as you say it works BUT this is not what I need. For example, I type /gh 21421 and a chat message will appear "The client says: 21421" but i need so that the value is taken from a variable kaka from serverside. And it should turn out "The client says: 321" and nothing else, until the variable changes on the server side
-
So I returned to the very first error "ERROR: attemp to concatenate local "kaka" (a nil value)"
-
I tried to use it like this --client function rain(kaka) outputChatBox ( "The client says: " .. kaka, client ) end addEvent("rain", true) addEventHandler( "rain", resourceRoot, rain ) addCommandHandler("gh",rain) --server function gap() local kaka = "321" triggerClientEvent("rain", resourceRoot, kaka) end addEvent( "gap", true ) addEventHandler( "gap", resourceRoot, gap ) Why when do I use the command "gh" writes to chat "The client says: gh" but i need "The Client says: 321" How to do it?
-
I do not yet understand how to solve this. Can you tell me how to use the element I need to transfer to the client?
-
How to call a variable from the server side to the client? What's my mistake? --client function rain(kaka) outputChatBox ( "The client says: " .. kaka, client ) end addEvent("rain", true) addEventHandler( "rain", localPlayer, rain ) --server function gap() local kaka = "321" triggerClientEvent(localPlayer, "rain", localPlayer, kaka) end addEvent( "gap", true ) addEventHandler( "gap", resourceRoot, gap ) ERROR: attemp to concatenate local "kaka" (a nil value)
-
@The_GTA Thank you, but I don’t think I need custom zones. If use this example, I would like it to work like this. For example, the user is in one location and as soon as he has changed it sounds playing. That is, I just need to check for a change in location
-
@Simple. can you help? How to check when a player changes location? Does the weather automatically change? I can do, for example, command check location BUT how to make it so that when the player changed the location the command worked on this event without a command.
-
I would also like to know the answer to this question. This only works for the local client. that is, you see where the head is turning, and for the other player you have your head "turned in one direction and froze" although you turn your head. On the local side, everything is fine, but how to implement this correctly for other players?
-
Hello! Can Is it possible to tie the weather to a specific location? For example, rain in Los Santos and clear weather in Las Venturas. The player who is in Los Santos sees the rain but player who is in Las Venturas see clear weather(sunny etc) That is, at the same time that there was different weather in different states. Is it possible?
-
Is it possible to disable acceleration on motorcycles using the button "forward arrow" I mean, when you press the button. The player leans forward thereby increasing the speed of the motorcycle. Can this be turned off?
-
solved. thanks you. BUT question about boats is relevant. Maybe someone knows
-
function enterVehicle ( theVehicle, seat, speed) local id = getElementModel(theVehicle) local myCar = getPedOccupiedVehicle(source) if id == 411 then setVehicleHandling(myCar,"maxVelocity",tonumber(400)) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) Infernus car accelerates to 199 km/h but i need more how to do it? How to make the car pick up speed higher than it should be? Using this code, I could limit it to a certain point; everything worked, but how to make it higher than what is allowed? I also noticed that the restrictions do not work on boats, why? How limit the speed of boats?
-
and one more question, I can’t find an answer to it For example, I have edit with text edit = guiCreateEdit(11, 40, 181, 27, "", false, window1) button = guiCreateButton(10, 195, 182, 27, "button", false, window1) local test = "123456" local check = guiGetText(edit) guiSetText(edit,test) addEventHandler("onClientGUIClick", root, function() if source == button then end end) What do I need to write on the button? The "test" variable is just an example. How do I delete the most recent character in edit? was 123456 after press button has become 12345 next time 1234 , 123 , 12, 1 and empty edit
-
@IIYAMA Ok, everything is fine. Another question, but how to use something like: [email protected] *****[email protected] I mean, so that the last three characters before the sign do not change.
