24.10.2012, 11:16
Here is an example :
PHP код:
CMD:changeweapon(playerid,params[])
{
new fstring[128], name[128], value;
if(sscanf(params, "s[128]i", name,value)) return SendClientMessage(playerid, -1, "Correct Usage: /changeweapon [Player's Name] [New Weapon]");
format(fstring,sizeof(fstring), "Users/%s.ini", name);
if(!fexist(fstring)) return SendClientMessage(playerid, -1, "The account you've typed in doesn't exist");
if(value < 1 || value > 46) return SendClientMessage(playerid, -1, "Weapon ID's are ranged from 1 to 46");
else
{
new INI:file = INI_Open(fstring);
INI_SetTag(file, "test"); //Change "test" to your tag that you have when someone registers.
INI_WriteInt(file, "Weapon", value);//Writing our integer in our .ini file.
INI_Close(file);//Closing our .ini File
new string[128];
format(string,sizeof(string), "You have changed %s's weapon to %i", name,value);
SendClientMessage(playerid,-1,string);
}
return 1;
}