SA-MP Forums Archive
Question about a command and Y_INI - 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: Question about a command and Y_INI (/showthread.php?tid=504104)



Question about a command and Y_INI - K9IsGodly - 02.04.2014

Код:
CMD:setkills(playerid,params[])
{
	new userid, kills;
	
	if(sscanf(params, "ui", userid, kills))
	    return SendClientMessage(playerid, COLOR_RED, "Syntax: /setkills [playerid/partofname] [level]");

	if(!IsPlayerConnected(userid))
	    return SendClientMessage(playerid, COLOR_RED, "That user is offline!");
}
I'm working on a small command right now (Obviously not finished) that basically sets a player's kills to 'x' amount. How can I have Y_INI save that via this command? So let's say in game I did /setkills 1 (part of name or playerid in this case) 300, how would it save into my Y_INI file? I have an enum defined and pKills is part of it. I've made other commands with something like PlayerInfo[playerid][pCrack]++; or += 2; or something else along those lines. I guess how can I make something like that, but case specific to what the user types in game? Y_INI is still confusing to me, so thanks to anyone that is able to understand what I'm saying and perhaps offer me some help.


Re: Question about a command and Y_INI - awsomedude - 02.04.2014

Give this a try
PlayerInfo[userid][pKills] = kills;


Re: Question about a command and Y_INI - K9IsGodly - 02.04.2014

Quote:
Originally Posted by awsomedude
Посмотреть сообщение
Give this a try
PlayerInfo[userid][pKills] = kills;
That was exactly what I wanted, thanks.