loop break
#1

Guys with this command it instantly saves me 50 (I have set limit to 50) lines of same reason I insert in command
So the question is how can I make that it will save it to only 1 line when I execute the command?

pawn Код:
#define LIMIT 50
new CrimeReasons[MAX_PLAYERS][LIMIT];
pawn Код:
CMD:makewanted(playerid,params[])
{
    new id, reason[80], string[50];
    if(sscanf(params, "us[80]",id ,reason)) return SendClientMessage(playerid,-1,"USAGE: REPORT <PlayerID/Part of Name> <Reason>");
    new INI:File = INI_Open(UserPath(id));
    for(new i;i<LIMIT;i++)
    {
        format(CrimeReasons[id][i],128,reason); // Params is the crime reason maybe you already have it formated then use the name of formated string
        format(string, sizeof(string), "Crime%d", i);  //To save in yini Crime1=50
        INI_WriteString(File,string,CrimeReasons[id][i]); // string and the crime reason being written
    }
    INI_Close(File);//Closing yini file
    return 1;
}
Reply


Messages In This Thread
loop break - by Lajko1 - 22.07.2015, 18:32
Re: loop break - by J4Rr3x - 22.07.2015, 18:40
Re: loop break - by Lajko1 - 22.07.2015, 18:52
Re: loop break - by xVIP3Rx - 22.07.2015, 18:58
Re: loop break - by Lajko1 - 22.07.2015, 20:07
Re: loop break - by xVIP3Rx - 22.07.2015, 20:10
Re: loop break - by Lajko1 - 23.07.2015, 09:36
Re: loop break - by Lajko1 - 23.07.2015, 21:47

Forum Jump:


Users browsing this thread: 5 Guest(s)