[AYUDA] Save skin.
#1

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й
Reply
#2

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
Reply
#3

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.
Reply
#4

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

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.
Reply
#6

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

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.
Reply
#8

parece que nesecita dini y dudb
Reply
#9

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));
  }
}
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)