SA-MP Forums Archive
Need to know if my code is right. - 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: Need to know if my code is right. (/showthread.php?tid=390128)



Need to know if my code is right. - Magic_Time - 04.11.2012

PHP код:
CMD:help(playeridparams[])
{
new 
MSG[250]
new 
Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
new 
mssg[250];
format(MSG,sizeof(MSG),"Player %s needs help:[Help Message: %s]"Namemssg);
SendClientMessageToAdmins(GREENMSG);
return 
1;
//.................................
stock SendClientMessageToAdmins(colortext[])
    {
        for(new 
aGetMaxPlayers(); ga++)
            if(
IsPlayerConnected(a) && IsPlayerAdmin(a))
                
SendClientMessage(acolortext);
    }




Re: Need to know if my code is right. - Glad2BeHere - 04.11.2012

pawn Код:
stock SendClientMessageToAdmins(color, string[])
{
    foreach(Player, i)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            SendClientMessage(i, color, string);
        }
    }
    return 1;
}

SendClientMessageToAdmins(GREEN, MSG);