Show team you on [zcmd]
#1

How do I show what team I am like

Team: [YOUR_TEAM]?

for [zcmd]
Reply
#2

pawn Код:
command(myteam, playerid, params[])
{
    if(GetPlayerTeam(playerid) == 1) SendClientMessage(playerid, WHITE, "Your team is TEAM_ONE");
    else if(GetPlayerTeam(playerid) == 2) SendClientMessage(playerid, WHITE, "Your team is TEAM_TWO");
    //etc...
    return 1;
}
Reply
#3

pawn Код:
new string[128];
format(string,sizeof(string),"Team: %d ",GetPlayerTeam(playerid));
SendClientMessage(playerid,COLOR,string);//COLOR is Color you want message to be..
Reply
#4

I edited thread because I forgot to put,
for zcmd
Reply
#5

Quote:
Originally Posted by cod5devious
Посмотреть сообщение
I edited thread because I forgot to put,
for zcmd
You want something like this?

pawn Код:
CMD:team(playerid, params[])
{
    if(!strcmp("id", params)) // /team id
    {
        new Fstring[10];
        format(Fstring,sizeof(Fstring),"Team ID: %d ",GetPlayerTeam(playerid));
        SendClientMessage(playerid, -1, Fstring);//-1 is Color you want message to be..
    }
    else
    {
        SendClientMessage(playerid, -1, "USAGE: /team id");
    }
    return 1;
}
-FalconX
Reply
#6

The one that I posted was for zcmd..
Reply
#7

pawn Код:
stock GetTeamName(playerid)
{
    new name[30];
    switch(GetPlayerTeam(playerid))
    {
        case 0: format(name, sizeof(name), "Grove Street");
        case 1: format(name, sizeof(name), "Ballas");
        case 2: format(name, sizeof(name), "Vagos");
        //..etc
    }
    return name;
}

CMD:myteam(playerid, params[])
{
    new string[128];
    format(string, sizeof(string), "You're a part of %s", GetTeamName(playerid));
    SendClientMessage(playerid, 0x00CCCCAA, string);
    return 1;
}
The reason I made it a stock is so you could add it other places...For instance in your /stats command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)