Jump to content

I need help with Rotation


Senze

Recommended Posts

Hey Guys i've got a Problem i've try to script if Someone enter a spezial ColShape the Object will Move but when you go some more in to ColShape it will move again and so on.

function ToreOeffnen()
if source == sfPDtor then
triggerServerEvent("sfPdTor", getLocalPlayer())
end
 
if source == sfPDschranke1 then
triggerServerEvent("sfPdSchranke1", getLocalPlayer())
end
 
if source == sfPDschranke2 then
triggerServerEvent("sfPdSchranke2", getLocalPlayer())
end
end
addEventHandler("onClientColShapeHit", getRootElement(), ToreOeffnen)

function SFPDSchranke1Auf()
local Team = getPlayerTeam(source)
 
if Team == teamSFPD then
moveObject(schrankeSF1, 5000, -1572.2048339844, 658.8115234375, 6.9281253814697, 0, -90, 0)
end
end
addEventHandler("sfPdSchranke1", getRootElement(), SFPDSchranke1Auf)

can some help me with my problem =(

mfg SenZe

Link to comment

hey also ich hab das so gelöst, du betrittst den marker, dann geht das Tor nach unten, du verlässt den marker dann gehts wieder nach oben ;)

p.s. den marker sieht man nicht ;)

gsgMarker1 =  createMarker (-380.45233154297, 1383.7810058594 , 44.376697540283 ,"cylinder",5, 0, 0, 255, 0 )
 
function createGateSp ()
gsg1  =  createObject (2933 , -380.45233154297, 1383.7810058594 , 44.376697540283, 0 , 0, 202.46923828125)
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGateSp )
 
 
 
function gateCheckinggsg (thePlayer)
local playeraccount = getPlayerAccount (thePlayer)
Team =  getAccountData (playeraccount, "Team")
if (Team == "GSG9") then
moveObject ( gsg1,3000, -380.45233154297, 1383.7810058594 , 5.376697540283)
end
end
addEventHandler ( "onMarkerHit", gsgMarker1, gateCheckinggsg )
 
 
function onLeave ( thePlayer, matchingDimension )
setTimer ( movingBackgsg1, 3000, 1, thePlayer )
end
addEventHandler ( "onMarkerLeave", gsgMarker1, onLeave )
 
function movingBackgsg1 ()
moveObject ( gsg1, 3000, -380.45233154297, 1383.7810058594 , 44.376697540283)
end

Link to comment

That is what they're doing.

Non-english, spam, double (And triple, AND quadruple, and in fact all the way up to quintuple a time or two) posting, spam again, misplaced topics (this is an especially popular one)

However, it seems that the current leaders don't care enough to actually moderate or instate someone who would.

Link to comment

robhol, instead of whining you should stay on topic or be silent. Thanks.

MasterTobi, varez, is right, please keep it english, there might be other people your post could be useful to.

On topic: Would be useful if you provide the whole part of your script, where you set the variables you use here. Do you get any errors in debugscript? And why not do the whole part server side?

Link to comment

It seems to me like you are trying to have each col shape move whenever a player hits it, and have it follow it's path without interruption.

What your code does now is reset the movement every time a user hits the col shape. My guess is that it's probably a bad idea to move the object while it's already moving.

To solve this, you should have the server only start moving the object once and reject other client events after that.

Link to comment

German:

Danke Tobi deutsch war mir persönlich lieber aber naja ;-)

die sache ist das moveObject eine Rotation sein soll für Schranken und wenn man den marker immer wieder betritt bringt das nix da rotiert die imemr weiter und weiter und weiter da du ja eine Relative Rotation zur aktuellen angeben musst =/

English:

Thanks Tobi but the real Problem is the follow und want to rotate the Object because its a barrier but its the same if you hit the Marker again it will rotate agian because the rotation in moveObject will be the relativ Rotaion to the Current Rotation =/

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...