SA-MP Forums Archive
[AYUDA] Save skin. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [AYUDA] Save skin. (/showthread.php?tid=119908)



[AYUDA] Save skin. - CristianTdj - 09.01.2010

Miren, intento hacer que el skin de un jugador que llevaba la ъltima vez no se pierda cuando sale. Hice una cosa en OnPlayerDissconect con Dini, pero me daba errores asн que lo quitй


Re: [AYUDA] Save skin. - John Rockie - 09.01.2010

Trata
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
   new Pname[24];
   GetPlayerName(playerid, Pname, 24);
   new file[128];
   format(file,sizeof(file),"\\skins\\%s.ini",udb_encode(Pname));
   dini_IntSet(file, "skin", GetPlayerSkin(playerid));
   return 1;
}
public OnPlayerSpawn(playerid)
{
  new Pname[24];
  GetPlayerName(playerid, Pname, 24);
  new file[128];
  format(file,sizeof(file),"\\skins\\%s.ini",udb_encode(Pname));
  if(!dini_Exists(file))
dini_Create(file);
  else
    SetPlayerSkin(playerid, dini_Int(file, "skin"));
  return 1;
}
NOTA: TIenes Que aser Un Folder en la carpeta de scriptfiles
Se tiene que llamar skins , si no no funsionara


Re: [AYUDA] Save skin. - CristianTdj - 10.01.2010

pawn Код:
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(467) : error 017: undefined symbol "udb_encode"
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(468) : error 017: undefined symbol "dini_IntSet"
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(477) : error 017: undefined symbol "udb_encode"
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(478) : error 017: undefined symbol "dini_Exists"
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(479) : error 017: undefined symbol "dini_Create"
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(481) : error 017: undefined symbol "dini_Int"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Y he creado la carpeta.


Re: [AYUDA] Save skin. - Zamaroht - 10.01.2010

Vas a tener que haber bajado dini, y arriba poner #include <dini>


Re: [AYUDA] Save skin. - CristianTdj - 10.01.2010

pawn Код:
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(458) : error 017: undefined symbol "udb_encode"
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(468) : error 017: undefined symbol "udb_encode"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Y ya tengo dini.


Re: [AYUDA] Save skin. - John Rockie - 10.01.2010

trataste
pawn Код:
#define udb_encode //arriva



Re: [AYUDA] Save skin. - Zamaroht - 10.01.2010

Eso solo va a quitar los errores, pero no lo va arreglar. Creo que tambiйn ademбs de dini necesitбs dutils, y sino, dudb.


Re: [AYUDA] Save skin. - Karkanos - 10.01.2010

parece que nesecita dini y dudb


Re: [AYUDA] Save skin. - MrDeath537 - 11.01.2010

Fijate si esto te sirve:

pawn Код:
enum pInfo
{
  pSkin
}

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerSpawn(playerid)
{
  new Nombre[MAX_PLAYERS];
  new file[100];
  GetPlayerName(playerid, Nombre, sizeof(Nombre));
  format(file, sizeof(file), "%s.ini", Nombre);

  if(fexist(file))
  {
  SetPlayerSkin(playerid, dini_Int(file, "Skin");
  }
}

public OnPlayerDisconnect(playerid)
{
  new Nombre[MAX_PLAYERS];
  new file[100];
  GetPlayerName(playerid, Nombre, sizeof(Nombre));
  format(file, sizeof(file), "%s.ini", Nombre);

  if(fexist(file))
  {
  dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
  }
  else
  {
  dini_Create(file);
  dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
  }
}



Re: [AYUDA] Save skin. - CristianTdj - 11.01.2010

MrDeath.

pawn Код:
C:\Documents and Settings\Compaq_Administrator\My Documents\san andreas\BASE jump\gamemodes\Jumping.pwn(383) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.