SA-MP Forums Archive
Name tags - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Name tags (/showthread.php?tid=308130)



Name tags - luckie12 - 02.01.2012

hey i have just searched all the tutorials and script examples on the forum for Name Tags like [ST] when a player with the tag [ST] joins his name is green automatic
and there are cars that only [ST] members can Join can you do that like ifPlayerNamecontains(playerid,"[ST]"); and then blablabla?

:P

thanx - luckie12


Re: Name tags - Babul - 02.01.2012

use your name-[tag] comparement check in OnPlayerLogin(), and if a tag matches, set a PVar containing the color. at each OnPlayerSpawn(), you can now apply the players color.
for the vehicles, you need to store the faction-tag in a string for each vehicle, apply the name-tag check again in OnPlayerStatechange() as driver, by using the playername with the vehicle string. if hey match, a player is allowed to stay in, else remove the player from the vehicle.
since you will use the tag check in more than 1 callback, change the tag check into a stock...

edit: pm sent. long one, lol


Re: Name tags - luckie12 - 02.01.2012

...easier said than done reading XD

can you give a example ? :P