#1

How can I make a radio command that works for several factions?
Reply
#2

Variable for faction IDs of players, on the top of script:
Код:
new pFactionID[MAX_PLAYERS]=-1;
Let 4 be the FactionID of SWAT group.

Now, under OnPlayerCommandText add:
Код:
if(strcmp(cmdtext("/needbackup", true)==0)
{
       if(pFactionID[playerid]==4)
       {
              for(new i=0; i>MAX_PLAYERS; i++)
              {
                     if(IsPlayerConnected(i))
                     {
                            name[24];
                            GetPlayerName(playerid, 24, name);
                            if(pFactionID[i]==4)
                            new str[64];
                            format(str, sizeof(str), "RADIO: %s is requesting backup.", name);
                            SendClientMessage(i, COLOR, str);
                     }
             }
     }
     else
    {
             return 0;
    }
    return 1;
}
Try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)