SA-MP Forums Archive
Who can help me - 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: Who can help me (/showthread.php?tid=363381)



Who can help me - rumen98 - 27.07.2012

Who can help me with this command to work with if(PlayerInfo[playerid][Radio] < 1)
i try this but no work who can help me

PHP код:
CMD:ar(playeridparams[])
{
    if(
gTeam[playerid] == TEAM_POLICE)
    {
        new 
string[100], pname[24];
        if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"USAGE: /ar [msg]");
        
GetPlayerName(playeridpname24);
        
format(stringsizeof(string), "** %s [%d] At [A-F Radio]: %s",pname,playerid,params);
        
printf("%s"string);
        for(new 
i=0;i<MAX_PLAYERS;i++)
        {
           if(
IsPlayerConnected(i)) if(gTeam[i] == TEAM_POLICESendClientMessage(iCOLOR_WHITEstring);
        }
    } else 
SendClientMessage(playeridCOLOR_RED"Only The Airforce Can Use This Radio!");
    return 
1;

Who can help me with this command to work with if(PlayerInfo[playerid][Radio] < 1)
i try this but no work who can help me


Re: Who can help me - Glint - 27.07.2012

Try this
pawn Код:
CMD:ar(playerid, params[])
{
    if(PlayerInfo[playerid][Radio] < 1)
    {
        if(gTeam[playerid] == TEAM_POLICE)
        {
            new string[100], pname[24];
            if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ar [msg]");
            GetPlayerName(playerid, pname, 24);
            format(string, sizeof(string), "** %s [%d] At [A-F Radio]: %s",pname,playerid,params);
            printf("%s", string);
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                if(IsPlayerConnected(i)) if(gTeam[i] == TEAM_POLICE) SendClientMessage(i, COLOR_WHITE, string);
            }    
        }
        else SendClientMessage(playerid, COLOR_RED, "Only The Airforce Can Use This Radio!");
        return 1;
}
if this is not what you mean then sorry i didn't completely understand you.


Re: Who can help me - rumen98 - 27.07.2012

Quote:
Originally Posted by Lexi'
Посмотреть сообщение
Try this
pawn Код:
CMD:ar(playerid, params[])
{
    if(PlayerInfo[playerid][Radio] < 1)
    {
        if(gTeam[playerid] == TEAM_POLICE)
        {
            new string[100], pname[24];
            if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ar [msg]");
            GetPlayerName(playerid, pname, 24);
            format(string, sizeof(string), "** %s [%d] At [A-F Radio]: %s",pname,playerid,params);
            printf("%s", string);
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                if(IsPlayerConnected(i)) if(gTeam[i] == TEAM_POLICE) SendClientMessage(i, COLOR_WHITE, string);
            }    
        }
        else SendClientMessage(playerid, COLOR_RED, "Only The Airforce Can Use This Radio!");
        return 1;
}
if this is not what you mean then sorry i didn't completely understand you.
dude how can remove if(gTeam[playerid] == TEAM_POLICE)
this gTeam i no have this and no need plase repair cmd only with if(PlayerInfo[playerid][Radio] < 1)