Line repeating
#3

An easier way to do this is to use a loop. More can be explained on loops on SA-MP Wiki.

pawn Код:
CMD:clearmychat(playerid, params[]) //A player has done '/clearmychat'
{
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_LIGHTRED, " USAGE: /clearmychat [lines(1-20)]");
    new lines = strval(params); //This is the number of lines that the player put in.
    if(lines < 1 || lines > 20) return SendClientMessage(playerid, COLOR_LIGHTRED, " You must have at least 1 line, and no more than 20 lines cleared at once.");
    //This basically means, if the number is less than 1, or greater than 20, send that message. This means players cannot put in negative numbers which would break your script and create an endless loop.
    for(new i = 0; i < lines; i++) SendClientMessage(playerid, -1, " ");
    return 1;
}
Simple.
Reply


Messages In This Thread
Line repeating - by venomlivno8 - 13.02.2014, 11:32
Re: Line repeating - by AaronFarley - 13.02.2014, 12:26
Re: Line repeating - by Threshold - 13.02.2014, 12:48
Re: Line repeating - by kooltuO - 13.02.2014, 12:50
Re: Line repeating - by CuervO - 13.02.2014, 13:26
Re: Line repeating - by ColeMiner - 13.02.2014, 13:34

Forum Jump:


Users browsing this thread: 1 Guest(s)