15.10.2010, 08:15
(
Последний раз редактировалось iggy1; 15.10.2010 в 09:45.
Причина: Typo
)
I'll give you an example of what Larzi said, Here 'file' is just an empty array.
But if you look at your second piece of code it has this
Making 'file' a destination. Hope this helps.
pawn Код:
dcmd_setskin(playerid, params[])
{
new id, pskin, pname[MAX_PLAYER_NAME];
new file[128];//nothing is done with this
new string[128];
if(PlayerInfo[playerid][AdminLevel] <2) return SendClientMessage(playerid, color_red, "* You do not have access to execute this command.");
if(sscanf(params, "ud", id, pskin)) return SendClientMessage(playerid, color_yellow, "* AdmHint: Usage /setskin [id] [skin id]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, color_red, "Hint: Player is not connected.");
SetPlayerSkin(id, pskin);
pskin = GetPlayerSkin(id);
dini_IntSet(file, "PlayerSkin",PlayerInfo[playerid][PlayerSkin] = pskin);
GetPlayerName(id, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "* AdmHint: You changed %s's skin to skinID: %d.", pname, pskin);
SendClientMessage(playerid, color_yellow, string);
return 1;
}
pawn Код:
format(file,sizeof(file),"/Users/%s.ini",name);