Deepu Posted February 25, 2014 Share Posted February 25, 2014 I want a help.... actually I want to get the direction in which the element moves..... (player) AnyOne got a function like that? Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 I don't know but you could use getElementRotation Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 hmm... I dont think so because with rotation you cant update it. The player can change direction too Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 What do you want to make actually ? Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 making farmer job Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 No i mean why do you want to get the direction of the player ? Link to comment
Moderators Citizen Posted February 25, 2014 Moderators Share Posted February 25, 2014 making farmer job He mean't with the rotation ... Because getElementRotation is the right function but you said it is not because you can't update it, so what do you mean by that ? Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 look a player can change his rotation any time he want. Thing is if he turns 30 degree east then the marker shud spawn in 30 degree east so it should be updated each second just like the dxDrawText Link to comment
Moderators Citizen Posted February 25, 2014 Moderators Share Posted February 25, 2014 Just use a timer then ? setTimer Note: dxDrawText isn't updating itself. Ht has to be used in a function attached to the onClientRender event which is like a really fast timer (faster that you can do with the setTimer function). Link to comment
Deepu Posted February 26, 2014 Author Share Posted February 26, 2014 but even if its a timer should i use this for it to be infinite? to make it update every second? setTimer(function, 500, 0) and can I also update the local x,y,z = getElementPosition(localPlayer) ? Link to comment
myonlake Posted February 26, 2014 Share Posted February 26, 2014 Are you sure you need to update the direction all the time? You can just make it render everything client-side and update some element data with the direction if necessary. Link to comment
Deepu Posted February 26, 2014 Author Share Posted February 26, 2014 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
Mr_Moose Posted February 26, 2014 Share Posted February 26, 2014 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
Deepu Posted February 26, 2014 Author Share Posted February 26, 2014 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
ReDFoX Posted February 26, 2014 Share Posted February 26, 2014 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 Citizen Posted February 26, 2014 Moderators Share Posted February 26, 2014 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
Deepu Posted February 26, 2014 Author Share Posted February 26, 2014 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
cheez3d Posted February 26, 2014 Share Posted February 26, 2014 You post a topic daily asking for help and you call yourself a good scripter. Cool story bro. Link to comment
Recommended Posts