Jump to content

Direction where the Player is moving....


Deepu

Recommended Posts

thing is I had error with my script where if

local x,y,z = getElementPosition(localPlayer) 

and I used it in a function......

s1 = createMarker(x+8, y,z, "cylinder", 1, 255, 2, 0) 

thing is that when I restart script then on ColShapeHit.....

the marker spawns in my previously loaded position before hitting the colShape

Link to comment

Not sure what you are trying to do here but if you want the marker to be added relative to the position of the player onColShapeHit then you should get the player position just before you create the marker and not in the loading code.

You should also note that onColShapeHit is a server sided event and since you use "localPlayer" in your code I assume that you are trying to make a client sided script. Therefore you should use: "onClientColShapeHit" instead. Maybe you should post the code since it's hard to know what you are trying to do here.

Link to comment

Son, you mean I don't know what is server sided and client sided?

before asking that question....

Son, what you talking abt? Check the TOPIC NAME.....

and I know that "client" will be added to all events if its in client events and no "client" in server events

Link to comment

Do you mean the serverside function 'getElementZoneName' ?

https://wiki.multitheftauto.com/wiki/GetElementZoneName

Here the example from the wiki:

  
  
function playerloc ( source ) 
    local playername = getPlayerName ( source ) 
    local location = getElementZoneName ( source ) 
    outputChatBox ( "* " .. playername .. "'s Location: " .. location, getRootElement(), 0, 255, 255 ) -- Output the player's name and zone name 
end 
addCommandHandler ( "loc", playerloc ) 
  
  

//edit

try it with this:

  
function( source ) -- My funciton with the argument source 
     setTimer( -- calling the function SetTimer 
           function() 
                local myZone = getElementZoneName( source ) -- the local variable myZone to get the Zonename of the source player 
                outputChatBox("The Player " .. getPlayerName( source ) .. " is in the direction " .. tostring(myZone), source) -- !!!! And output it to the chatbox !!!!!! 
           end, 500, 0) -- call the function every 0,5 seconds, every time when the function ended 
end 
  

Link to comment
  • Moderators
Son, you mean I don't know what is server sided and client sided?

before asking that question....

Son, what you talking abt? Check the TOPIC NAME.....

and I know that "client" will be added to all events if its in client events and no "client" in server events

Ok lol, just calm down Deepu stop arguing with members who want to help you.

Don't you think that at this moment YOU and not us is the problem ?

Because we still don't understand what you actually want to do after 7 posts from you.

Call other "son" because someone treats you as a beginner (and sorry, but you're still a beginner and you're really close to your 61% of your signature) is disrespectful. Nobody will help you more if you are talking to them like you just do.

And about your problem of your marker position you want to be updated to make it follow the player on his right (that's what I understood so far) use this function and call it with a setTimer:

https://wiki.multitheftauto.com/wiki/Get ... ceRotation

X and Y will be the current player position, the distance will be 8 and angle will be 90 (means right).

Link to comment

what resource you want? Tell me and I will make it for you.......

If I make the resource just as you want it then give me 200$

ready?

Cuz I am not A freaking beginner scripter got it? And if you guys are jealous of me then please don't reply

PS: Admin Lock this topic so that I figure it out myself

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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