hrtht
-
Posts
21 -
Joined
-
Last visited
Posts posted by hrtht
-
-
Can somebody help?
-
Help please!
-
function repairVehicle ( thePlayer, commandName)
if ( isPedInVehicle ( thePlayer ) ) then
local theVehicle = getPedOccupiedVehicle ( thePlayer)
local succes = fixVehicle ( theVehicle )
if ( succes ) then
outputChatBox (" 1 ", thePlayer )
outputChatBox ( "0", thePlayer )
end
end
end
addCommandHandler ( "rv", repairVehicle)Its serverside
-
3 hours ago, Patrick said:
function ghostmode_on() for i,v in pairs(getElementsByType("player")) do --LOOP through all players setElementCollidableWith(v, localPlayer, false) -- Set the collison off with the other vehicles. end outputChatBox("You are now a Ghost") end addCommandHandler("ghostmode", ghostmode_on) -- Add the /ghostmode Command.
Replace vehicle elements with players.
How to add a output for saying that you're no longer Ghost?
-
function ghostmode_on() local playerVehicle = getPedOccupiedVehicle(localPlayer) -- Get the players vehicle if(playerVehicle) then -- Check the return value. for i,v in pairs(getElementsByType("vehicle")) do --LOOP through all vehicles setElementCollidableWith(v, playerVehicle, false) -- Set the collison off with the other vehicles. end outputChatBox("You are now a Ghost") end end addCommandHandler("ghostmode", ghostmode_on) -- Add the /ghostmode Command.
What I need to change to get it working with players? I'm new help me man
-
-
-
5 hours ago, Motar2k said:
If you use setJetpackWeaponEnabled to make weapons usable on jetpack and then wield them on jetpack, the weapon can become invisible. I know, that's why Im asking another way to do it
-
How to fix invicible weapon when press for the jetpack?
-
3 hours ago, Patrick said:
I think the only way if you hide the chat, with showChat
Or cancel the keypress event:addEventHandler("onClientKey", root, function(key, state) if key == "t" and state then cancelEvent() end end)
thanks man !
-
please
-
3 hours ago, iDannz [Breno] said:
All you should do is get new look at coordinates -> send to server -> sync to others clients
but remember; dont try to destroy your server's network
--serverside addEvent('syncLookAt', true) addEventHandler('syncLookAt', root, function(x,y,z) triggerLatentClientEvent("setLookAt", 30000, false, client, x,y,z) -- triggerClientEvent("setLookAt", client, x,y,z) end) --clientside local screenW, screenH = guiGetScreenSize() setTimer(function() local x,y,z = getWorldFromScreenPosition(screenW*0.5, screenH*0.5, 10) triggerLatentServerEvent("syncLookAt", 30000, false, localPlayer, x,y,z) -- triggerServerEvent("syncLookAt", localPlayer, x,y,z) end, 200, 0) addEvent('setLookAt', true) addEventHandler('setLookAt', root, function(x,y,z) setPedLookAt(source, x,y,z) end)
Still doesn't work, the head is stuck to the right, I want it for all not just local player man
-
IM LOOKING FOR IT
-
3 hours ago, MrTasty said:
You're setting everyone's look-at coordinates to the centre of the localPlayer's screen, not the respective player's screen. Also, last time I used setPedLookAt, it didn't work for remote players correctly. Also, read the Wiki notices (specifically the first one - don't run this on onClientRender):
Note: Avoid calling setPedLookAt every frame as this can cause bugs like being invincible to burning. Note: For remote players, you have to use setPedAimTarget before setPedLookAt. I started days ago on this.. if you can send me the code it would be great man
-
3 hours ago, MrTasty said:
Share the code that you need help with, or at least tell us which script it is if it's from MTASA community resources website.
addEventHandler("onClientRender", getRootElement(), function()
for k,player in ipairs(getElementsByType("player")) do
if getElementHealth(player) >= 1 then
local width, height = guiGetScreenSize ()
local lx, ly, lz = getWorldFromScreenPosition ( width/2, height/2, 10 )
setPedLookAt(player, lx, ly, lz)
end
end
end) -
How to see the other player every time he moves his head? current scripts only leave it looking to one side.
-
-
3 hours ago, Patrick said:
Just an idea:
Attach a colshape to the ped, and when somebody hit that colshape, who jumping, do some fall animation.> createColSphere, attachElements, onClientColShapeHit, getPedSimplestTask, triggerServerEvent, setPedAnimation (on server side)
Let me try man, thanks!
-
How to do this?
-
[HELP] Moving head with mouse
in Scripting
Posted
Nobody?