27.05.2012, 10:54
Ok so i made the commande but when i use the command i get file name %s.ini instead of what i input as text. How i can fix that or get dealer when i type /newdealer that file name is either what i typed by command or automatically by id. Any help would be great. Thanks
So output is %s.ini and in file is
[Dealership Info]
Owner = 0
pawn Код:
YCMD:newdealer(playerid, params[], help)
{
new dealer[32];
if(!(PlayerInfo[playerid][pAdmin] == 1338)) return SCM(playerid, COLOR_INFO,"You are not authorized to use this command");
{
if (sscanf(params, "s[64]",dealer)) SendClientMessage(playerid, COLOR_INFO, "Usage: \"/newdealer name"");
new
Dealer[32];
format(Dealer, sizeof (Dealer), "dealer/%s.ini", dealer);
new
INI:dealerfile = INI_Open(DEALER_FILE);
INI_SetTag(dealerfile, "Dealership Info");
INI_WriteInt(dealerfile, "Owner", DealerInfo[playerid][dOwner]);
INI_Close(dealerfile);
return 1;
}
}
[Dealership Info]
Owner = 0