-.Paradox.- Posted July 23, 2013 Posted July 23, 2013 Hello all, I want a little script, if player was in team Test he's nametagcolor and blip must be same as team color, i want to make a script like that. Well, i tried this using this but need some functions, r, g, b = getTeamColor(teamElement) setPlayerNametagColor(playerElement, r, g ,b) Can somebody help me with a code or someting elser thanks If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Martyz Posted July 23, 2013 Posted July 23, 2013 didn't test, but should work: blip = {} function spawn(posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) if(not isElement(blip[getPlayerName(source)])) then blip[getPlayerName(source)] = createBlipAttachedTo(source) end if(getTeamName(theTeam) == 'test') then local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(source, r, g, b) setBlipColor(blip[getPlayerName(source)], r, g, b, 255) end end addEventHandler('onPlayerSpawn', getRootElement(), spawn) this is server-side script !
-.Paradox.- Posted July 23, 2013 Author Posted July 23, 2013 Okay If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Jaysds1 Posted July 23, 2013 Posted July 23, 2013 (edited) What if the player changes their name? The table wont free it until the resource is restarted/stopped. Anyways, try this: local blip = {} addEventHandler('onPlayerSpawn',root, function(_, _, _, _, theTeam) if (not isElement(blip[source])) then blip[source] = createBlipAttachedTo(source) end if(getTeamName(theTeam) == 'test') then local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(source, r, g, b) setBlipColor(blip[source], r, g, b, 255) end end) setTimer(function() for source,b in pairs(blip)do if not isElement(source) then destroyElement(b) blip[source] = false end end end,10000,0) Edited July 23, 2013 by Guest My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Jaysds1 Posted July 23, 2013 Posted July 23, 2013 Nah, I've set a timer for it to run every 10secs to see if every player is still in the server so there's no lose ends of the script. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
-.Paradox.- Posted July 23, 2013 Author Posted July 23, 2013 Not only for Test team i want it for every team because i have 4 and i want when player login he's nametagcolor and blip be the same as Team color. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Jaysds1 Posted July 23, 2013 Posted July 23, 2013 ok, try this: local blip = {} addEventHandler('onPlayerSpawn',root, function(_, _, _, _, theTeam) if (not isElement(blip[source])) then blip[source] = createBlipAttachedTo(source) end local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(source, r, g, b) setBlipColor(blip[source], r, g, b, 255) end) setTimer(function() for source,b in pairs(blip)do if not isElement(source) then destroyElement(b) blip[source] = false end end end,10000,0) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
-.Paradox.- Posted July 23, 2013 Author Posted July 23, 2013 Thanks for youre help.....i will try If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Wont work i tried debugscript 3 it show nothing. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
iMr.3a[Z]eF Posted July 24, 2013 Posted July 24, 2013 ok, try this:local blip = {} addEventHandler('onPlayerSpawn',root, function(_, _, _, _, theTeam) if (not isElement(blip[source])) then blip[source] = createBlipAttachedTo(source) end local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(source, r, g, b) setBlipColor(blip[source], r, g, b, 255) end) setTimer(function() for source,b in pairs(blip)do if not isElement(source) then destroyElement(b) blip[source] = false end end end,10000,0) Where is the 2nd argument of the function createBlipAttachedTo. To Visit Us Press Here: mtasa://5.9.206.180:22002
Martyz Posted July 24, 2013 Posted July 24, 2013 ok, try this:<...> Where is the 2nd argument of the function createBlipAttachedTo. only 1 argument is required, others are optional Nah, I've set a timer for it to run every 10secs to see if every player is still in the server so there's no lose ends of the script. You can use onPlayerQuit for that, you dont need timer.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Won't work help guys. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 local blip = { } addEventHandler ( "onPlayerLogin", root, function ( ) if ( not isElement ( blip [ source ] ) ) then blip [ source ] = createBlipAttachedTo ( source ) end local theTeam = getPlayerTeam ( source ) if ( not theTeam ) then return end local r, g, b = getTeamColor ( theTeam ) setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Won't work too, i tried debugscript 3 it show only some errors from exp_system. http://postimg.org/image/u01fhle5d/ If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 local blip = { } addEventHandler ( "onPlayerLogin", root, function ( ) if ( not isElement ( blip [ source ] ) ) then blip [ source ] = createBlipAttachedTo ( source ) end local theTeam = getPlayerTeam ( source ) if ( not theTeam ) then outputChatBox ( "YOU HAVE NO TEAM", source ) return end local r, g, b = getTeamColor ( theTeam ) setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) Try that and see what it says when you login. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Okay gonna try. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 It write you have no team http://postimg.org/image/mbsh5bug1/ and i have that bug in flag scoreboard If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 You should combine the blip script with your team loader system. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 I can't understand. I'm using autoteams. I will send you code of it in Private message. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 local blip = { } addEvent ( "onPlayerTeamChanged", true ) addEventHandler ( "onPlayerTeamChanged", root, function ( theTeam ) if ( not theTeam ) then return end if ( not isElement ( blip [ source ] ) ) then blip [ source ] = createBlipAttachedTo ( source ) end local r, g, b = getTeamColor ( theTeam ) setPlayerNametagColor ( source, r, g, b ) setBlipColor ( blip [ source ], r, g, b, 255 ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( blip [ source ] ) then destroyElement ( blip [ source ] ) end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Gonna try If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Working perfect Thank you, youre the best :D If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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