SA-MP Forums Archive
[HELP] portable radio - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] portable radio (/showthread.php?tid=353990)



[HELP] portable radio - V4at - 25.06.2012

How to make a portable radio, for players that have:

Код:
if(GetPlayerSkin(playerid) == 157 || GetPlayerSkin(playerid) == 123 || GetPlayerSkin(playerid) == 156)
        {



Re: [HELP] portable radio - Randy More - 25.06.2012

Do you mean you want to have all players with each skin stated to communicate with each other? if so..

pawn Код:
stock SendPRTransmission(color, msg[], team)
{
    for(new i; i < MAX_PLAYERS; i++) // foreach(Player, i)
    {
         if(GetPlayerSkin(i) == team)
         {
             SendClientMessage(i, color, msg);
         }
    }
    return 1;    
}

CMD:pr(playerid, params[])
{
   new string[256], name[MAX_PLAYER_NAME];
    if(IsPlayerLogged[playerid]) // Whatever variable you use for checking if logged or not.
    {
        if(isnull(params)) return SendClientMessage(playrid, SOME_COLOR,"USAGE: /pr [text]");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof(string),"[PR]: %s: %s", name, params);
        if(GetPlayerSkin(playerid) == 157) return SendPRTransmission(SOME_COLOR, string, 157); // So on.
    }
    return 1;
}