hi im new on scripting but if u can help?
#4

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        if(gTeam[playerid] == 255)
        {
            SendClientMessage(playerid, 0xFFFF00FF, "You just used \"!\" for team chat, but you are not in any team right now!");
            return 0;
        }
        text[0] = ' ';
        new str[128];
        format(str, sizeof(str), "[Team] %s:%s", PlayerName(playerid), text);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && gTeam[playerid] == gTeam[i])
            {
                SendClientMessage(i, 0xFFFF00FF, str);
            }
        }
        return 0;
    }
    return 1;
}
if you don't have PlayerName function, then add this somewhere in your script:

pawn Код:
stock PlayerName(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    return pName;
}
Reply


Messages In This Thread
hi im new on scripting but if u can help? - by MEXICAN_NORTE - 21.01.2010, 19:06
Re: hi im new on scripting but if u can help? - by SiJ - 21.01.2010, 19:12
Re: hi im new on scripting but if u can help? - by MEXICAN_NORTE - 21.01.2010, 19:13
Re: hi im new on scripting but if u can help? - by MadeMan - 21.01.2010, 19:28

Forum Jump:


Users browsing this thread: 2 Guest(s)