Help how can I show the profession some has in the chat?

Started by Kelvinvenema, Sep 26, 2020, 06:02 PM

Previous topic - Next topic

Kelvinvenema

Hello guys I have run into some problems. I recently made a command EmergencyChat for my roleplay server. But the thing is I would like it to show what profession everybody has For example to visualize it:

EmergencyChat: Firefighter: TheKiller01:  "Message"
EmergencyChat: Police: Theweirdguy1:  "Message"
EmergencyChat: Paramedic: Niceman: "Message"

The code down here has something called + "Profession" +
The line with Profession should give the player the string with the Profession that depends on their Job if they are FireFighter the command should output firefighter.

I can't seem to work out how I should do it,
I really appreciate if you could help,

Code:

for( local i = 0; i <= GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( plr.Skin ==1 || 5 || 6) )
{
MessagePlayer("[#A42F2B][Emergency-Chat] " +Profession+" "+player.Name+  ":[#0CF4D4]  " + text + "", plr);