Help, quick question
#10

There's no need for the use of strings in OnPlayerText, especially when you're not adding anything that isn't already included, like the player ID for example.

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(PlayerTeam[playerid] == 1) return SendClientMessageToAll(COLOR_GROVE, text);
  if(PlayerTeam[playerid] == 2) return SendClientMessageToAll(COLOR_BALLAS, text);
  return 1;
}
Without the use of player team based chat:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, GROVE_COLOR);
    }
    else if(PlayerTeam[playerid] == TEAM_BALLAS)
    {
        SetPlayerColor(playerid, BALLAS_COLOR);
    }
    return 1;
}
That's basically all you need to know, but if you're using a custom OnPlayerText such as using formatted strings to send player messages, this won't work, and you will have to use the first code as an example, with the format lines included. Otherwise, just make sure it returns 1 and you have no SendPlayerMessageToAll or SendClientMessageToAll functions in your OnPlayerText.
Reply


Messages In This Thread
Help, quick question - by DJTunes - 10.01.2013, 00:47
Re: Help, quick question - by Glad2BeHere - 10.01.2013, 01:01
Re: Help, quick question - by Stevee - 10.01.2013, 01:39
Re: Help, quick question - by DJTunes - 10.01.2013, 02:36
Re: Help, quick question - by Glad2BeHere - 10.01.2013, 02:45
Re: Help, quick question - by [HK]Ryder[AN] - 10.01.2013, 02:58
Re: Help, quick question - by Glad2BeHere - 10.01.2013, 03:15
Re: Help, quick question - by [HK]Ryder[AN] - 10.01.2013, 03:26
Re: Help, quick question - by ThePhenix - 10.01.2013, 04:07
Re: Help, quick question - by Threshold - 10.01.2013, 04:21

Forum Jump:


Users browsing this thread: 1 Guest(s)