SA-MP Forums Archive
/suspect - 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: /suspect (/showthread.php?tid=583708)



/suspect - Lajko1 - 30.07.2015

This code isn't working correctly, it instantly opens 15 lines of crime I insert in command.
How can I make it will open line by line for each crime I will write? So 1 line = 1 crime? max up to 15 crimes

pawn Код:
#define LIMIT 15
new CrimeReasons[MAX_PLAYERS][LIMIT];
pawn Код:
CMD:suspect(playerid,params[])
{
    new id, crime[80], string[128];
    if(sscanf(params, "us[80]",id ,crime)) return SendClientMessage(playerid,-1,"USAGE: /suspect [PlayerID/Part of Name] [Crime]");
    new INI:File = INI_Open(UserPath(id));
    for(new i;i<LIMIT;i++)
    {
        format(CrimeReasons[id][i],128,crime);
        format(string, sizeof(string), "Crime%d", i);
            INI_WriteString(File,string,CrimeReasons[id][i]);
    }
    INI_Close(File);
    return 1;
}