Wei Posted April 15, 2012 Share Posted April 15, 2012 Why is allways marker so up from floor ? Picture : EDIT: CODE: createMarker ( 1177.53137, -1319.97766, 14.07530, "cylinder", 1, 255, 255, 0, 170 ) Link to comment
Absence2 Posted April 15, 2012 Share Posted April 15, 2012 I don't know how to explain it, but it'll always be like that, due to your character's given position with the freeroam CMD ( and any other unless you minus it ). Anyhow, just cut a '1' off from the 'z' argument. 14 > 13 createMarker ( 1177.53137, -1319.97766, 13.07530, "cylinder", 1, 255, 255, 0, 170 ) Link to comment
Wei Posted April 15, 2012 Author Share Posted April 15, 2012 whats the problem here ... CODE: function spawnmepolice ( thePlayer ) setPlayerTeam ( thePlayer, police ) setPlayerNametagColor ( thePlayer, 0, 0, 205 ) setElementModel ( thePlayer, 281 ) giveWeapon ( thePlayer, 3, 10000 ) outputChatBox ( "*INFO: You are now employed as Police Officer", thePlayer, 255, 255, 0 ) end addEventHandler("onPlayerMarkerHit", policemarker, spawnmepolice ) It doesn't spawn me in Police. No errors anywhere Link to comment
drk Posted April 15, 2012 Share Posted April 15, 2012 Because there is no 'onPlayerMarkerHit'. It's 'onMarkerHit'. Link to comment
Aibo Posted April 15, 2012 Share Posted April 15, 2012 "onPlayerMarkerHit" is triggered by players, so player element is the source, and marker element is the first argument passed to the function. either edit your code or use "onMarkerHit" event instead. Link to comment
Guest Guest4401 Posted April 15, 2012 Share Posted April 15, 2012 Because there is no 'onPlayerMarkerHit'. It's 'onMarkerHit'. https://wiki.multitheftauto.com/wiki/OnPlayerMarkerHit local policemarker = createMarker ( 1177.53137, -1319.97766, 13.07530, "cylinder", 1, 255, 255, 0, 170 ) function spawnmepolice(markerHit) if markerHit == policemarker then setPlayerTeam(source, police) setPlayerNametagColor(source, 0,0,205) setElementModel(source, 281) giveWeapon(source, 3, 10000) outputChatBox("*INFO: You are now employed as Police Officer", source, 255,255,0) end end addEventHandler("onPlayerMarkerHit", root, spawnmepolice) ? Link to comment
Wei Posted April 15, 2012 Author Share Posted April 15, 2012 last problem today. It doesn't work. Shows empty exports [ 'scoreboard' ]:addScoreboardColumn ( 'Group' ) addEventHandler ( "onPlayerChat", root, function ( _, thePlayer ) local theSkin = getElementModel ( thePlayer ) if ( theSkin == 217 ) then sGroup = "Admin" elseif ( theSkin == 1 ) then sGroup = "Guest" end setElementData ( thePlayer, 'Group', sGroup ) end ) Link to comment
drk Posted April 15, 2012 Share Posted April 15, 2012 local sGroup; call ( getResourceFromName ( 'scoreboard' ), 'addScoreboardColumn', 'Group' ); addEventHandler ( 'onPlayerChat', root, function ( ) if ( getElementModel ( source ) == 217 ) then sGroup = 'Admin'; elseif ( getElementModel ( source ) == 1 ) then sGroup = 'Guest'; end setElementData ( source, 'Group', sGroup ); end ) Link to comment
Wei Posted April 15, 2012 Author Share Posted April 15, 2012 read about onPlayerChat and its parameters. neither of them is a player element.and attaching this to chat event is kinda stupid. I've modyfied that from 1 script.... I will make timer... Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now