Seeing team Radio
#1

Guys i did this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new strName[MAX_PLAYER_NAME], strOut[129];

    GetPlayerName(playerid, strName, sizeof(strName));
    if(text[0] == ',') // he used ' ! ' before text in chat box ( change as you wish )
    {
        new string[129];
        strmid(string, text, 1, strlen(text), 129);
        format(strOut, 129, "[Team Radio] %s: %s", strName, string);

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
                SendClientMessage(i, 0x00FF00FF, strOut);
        }
        return 0; // prevent the message to be sent on global chat
    }
    return 1;
}
But other team member can also see radio?? What is this?
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    new strName[MAX_PLAYER_NAME], strOut[129];

    GetPlayerName(playerid, strName, sizeof(strName));
    if(text[0] == ',') // he used ' ! ' before text in chat box ( change as you wish )
    {
        new string[129];
        strmid(string, text, 1, strlen(text), 129);
        if(gTeam[playerid] == YOURTEAMHERE)
        {
            format(strOut, 129, "[Team Radio] %s: %s", strName, string);

            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
                    SendClientMessage(i, 0x00FF00FF, strOut);
            }
        }
        return 0; // prevent the message to be sent on global chat
    }
    return 1;
}
Reply
#3

I have 4 teams now?
Reply
#4

pawn Код:
public OnPlayerText(playerid, text[])
{
    new strName[MAX_PLAYER_NAME], strOut[129];

    GetPlayerName(playerid, strName, sizeof(strName));
    if(text[0] == ',') // he used ' ! ' before text in chat box ( change as you wish )
    {
        new string[129];
        strmid(string, text, 1, strlen(text), 129);
        if(gTeam[playerid] == YOURTEAMHERE || gTeam[playerid] == YOURTEAMHERE || gTeam[playerid] == YOURTEAMHERE || gTeam[playerid] == YOURTEAMHERE)
        {
            format(strOut, 129, "[Team Radio] %s: %s", strName, string);

            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
                    SendClientMessage(i, 0x00FF00FF, strOut);
            }
        }
        return 0; // prevent the message to be sent on global chat
    }
    return 1;
}
the example i gave last hour ago is for 1 team only. the code i gave now is for 4 teams
Reply
#5

Thnx Bro.

One more request:
I have class system. When ever a player killed, the dialogue appears but i don't want that. I want that we only select class at once than if we want to change class than we use cmd (I have that cmd). So i want the class dialogue only appear at once and we select class. Than if we die we don't need to select class , it did automatically and give us previously class.

pawn Код:
public OnPlayerSpawn(playerid)
{
   
    ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 3)  \nEngineer Class  (Need Rank 5)  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8)  \nSpy Class  (Need Rank 9)", "Choose","")
   
    return 1;
}
Reply
#6

pawn Код:
new DialogRepeat[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    DialogRepeat[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    DialogRepeat[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(DialogRepeat[playerid] == 0)
    {
        DialogRepeat[playerid] = 1;
        ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class  (Need No Rank)  \nSniper Class  (Need Rank 3)  \nEngineer Class  (Need Rank 5)  \nJet-Trooper Class  (Need Rank 7)  \nPilot Class  (Need Rank 8)  \nSpy Class  (Need Rank 9)", "Choose","");
    }
    return 1;
}
Reply
#7

No i want that when player die or some one kill him then there should not appear dialogue. But when he type a special cmd (i have it /switchclass) than he can switch class. Otherwise he can't.

Its still same..
Reply
#8

And Romel team radio is not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)