Adding more crimes with 1 command
#3

Код:
CMD:makewanted(playerid,params[])
{
	new 
		id, 
		reason[80], 
		string[50]
	;

    if(sscanf(params, "us[80]", id ,reason)) 
    	return SendClientMessage(playerid,-1,"USAGE: /makewanted [PlayerID/Part of Name] [Reason]");

   	if(!IsPlayerConnected(id)) 
   		return SendClientMessage(playerid, -1, "Player Not connected");

   	format(PlayerInfo[id][pCrimes], 80, "%s,%s", PlayerInfo[id][pCrimes], reason);

    new INI:File = INI_Open(UserPath(id));
    INI_WriteString(File,"Crimes",PlayerInfo[id][pCrimes]);
    INI_Close(File);

    format(string, sizeof(string), "Crime %s saved", reason);
    SendClientMessage(playerid, -1, string);

	return 1;
}
So it will be saved as: OldCrime,NewCrime.
Another added crime will be as: OldestCrime,OldCrime,NewCrime. And so on..
Reply


Messages In This Thread
Adding more crimes with 1 command - by Lajko1 - 19.07.2015, 11:13
Re: Adding more crimes with 1 command - by Lajko1 - 20.07.2015, 12:07
Re: Adding more crimes with 1 command - by Evocator - 20.07.2015, 12:22
Re: Adding more crimes with 1 command - by Lajko1 - 20.07.2015, 19:10
Re: Adding more crimes with 1 command - by Lajko1 - 21.07.2015, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)