How To save skin
#1

i want to save the player skin

how can i ?

just give me examples

pawn Код:
CMD:skin(playerid,params[])
{
  new skinid,string[128],file[64];
  if(sscanf(params, "i",skinid)) return SendClientMessage(playerid,0xFFDD00AA, "** Usage: /skin [skinid].");
  if(skinid > 299 || skinid < 0) return SendClientMessage(playerid,0xFFDD00AA, "* Invalid Skin ID.");
  format(file,sizeof file,"Admin/%s.ini",GetName(playerid));
  INI_Open(file);//Opening the file with SII include
  INI_SetString("Skin",skin);
  INI_WriteInt("Skin",skinid);//Writing the line "Level" the selected admin level.
  INI_Save();//Saving the file
  INI_Close();//Closing the file
  SetPlayerSkin(playerid,skinid);
  format(string,sizeof(string), "** You changed your skin to %d",skinid);
  SendClientMessage(playerid,0xFFDD00AA,string);
  return 1;
}
Reply
#2

Usually you 'save' the skin when the player disconnects
You need GetPlayerSkin for that then and INI_Save.

If you connect to the server again you need SetPlayerSkin and Init_Load
Reply
#3

example please in pawno
Reply
#4

He mean that you must add
pawn Код:
INI_WriteInt("Skin", GetPlayerSkin(playerid));
on
pawn Код:
public OnPlayerDisconnect(playerid, reason)
And just use the command like so
pawn Код:
CMD:skin(playerid,params[])
{
    new skinid,string[128],file[64];
    if(sscanf(params, "i",skinid)) return SendClientMessage(playerid,0xFFDD00AA, "** Usage: /skin [skinid].");
    if(skinid > 299 || skinid < 0) return SendClientMessage(playerid,0xFFDD00AA, "* Invalid Skin ID.");
    format(string,sizeof(string), "** You changed your skin to %d",skinid);
    SendClientMessage(playerid,0xFFDD00AA,string);
    SetPlayerSkin(playerid,skinid);
    return 1;
}
Reply
#5

Hello,
In The Logged event you add exemple :
PHP код:
new skin PlayerInfo[playerid][pSkin]);
SetPlayerSkin(playerid,skin); 
Reply
#6

little bit more explanation ?

]Rafaellos[
Reply
#7

When a player disconnects, usually you'r administrator system save player's data (money, score, etc). In that data, you will save skin too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)