SA-MP Forums Archive
SendClientMessage IF Exceeding - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendClientMessage IF Exceeding (/showthread.php?tid=273982)



SendClientMessage IF Exceeding - kingchandio - 04.08.2011

i have only /sethelper 5 levels so i want to know how to stop some one if some one tries to exceed limit? and send him msg?

pawn Код:
CMD:sethelper(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 9)
        {
            new
                giveplayerid,
                level;
            if(!sscanf(params, "ui", giveplayerid,level))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new
                        sendername[MAX_PLAYER_NAME],
                        giveplayername[MAX_PLAYER_NAME],
                        string[128];
                    GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
                    GetPlayerName(giveplayerid, giveplayername, MAX_PLAYER_NAME);

                    format(string, sizeof(string), "The admin %s has made you a level  %d Helper",sendername,level);
                    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "You have made %s a level %d Helper",giveplayername,level);
                    SendClientMessage(playerid, COLOR_TOMATO, string);
                    PlayerInfo[giveplayerid][pHelper] = level;
                }
            }
            else SendClientMessage(playerid, 0xAFAFAFAA, "SYNTAX:/sethelper [playerid] [level]");
        }
        else SendClientMessage(playerid, 0xAFAFAFAA, "You are not a Community Staff Member! Or Your Level is too low!");
    }
    return 1;
}



Re: SendClientMessage IF Exceeding - [HiC]TheKiller - 04.08.2011

pawn Код:
if(level < 0 || level > 5) return SendClientMessage(playerid, 0xFF0000, "Levels are between 0 and 5!");
Put that under
pawn Код:
if(giveplayerid != INVALIE_PLAYER_ID)



Re: SendClientMessage IF Exceeding - kingchandio - 04.08.2011

thanks its working