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



Command Help - nigga'z - 09.01.2012

I need help how to make command changepassword I use y_ini system for save data


Re: Command Help - nigga'z - 10.01.2012

help me please rep +


Re: Command Help - ScriptJorkis - 10.01.2012

what dialog or just /changepassword <pass> ?


Re: Command Help - nigga'z - 10.01.2012

just /changepassword [New Pass]


Re: Command Help - mitosking - 10.01.2012

I do it with ZCMD and sscanf:

pawn Код:
CMD:changepassword(playerid, params[])
{
new pass[24];
if(sscanf(params, "s[24]", pass)) return SendClientMessage(playerid, -1, "USAGE: /changepassword <pass>");
new file[128], pName[24];
GetPlayerName(playerid, 24, pName);
format(file, 128, "folder/%s.ini", pName); // Insert the utents' folder. Example: Utents/%s.ini.
new File:INI_Open(file);
INI_WriteString(File, "Password", pass);
INI_Close(File);
SendClientMessage(playerid, -1, "Your password has been changed.");
return 1;
}



Re: Command Help - nigga'z - 10.01.2012

Код:
CMD:changepassword(playerid, params[])
{
	new passtring[24];
	if(sscanf(params, "s[24]", passtring)) return SendClientMessage(playerid, -1, "USAGE: /changepassword <pass>");
	
	new
		File:INI_Open(UserPath);
	INI_WriteString(File, "Password", udb_hash(passtring));
	INI_Close(File);
	
	SendClientMessage(playerid, -1, "Your password has been changed.");
	return 1;
}
it's ok?


Re: Command Help - nigga'z - 10.01.2012

help me please