[Ajuda] Porque nao compila?
#1

Galera, fiz uma especie de um sistema para salvar a skin do player, mas nao sei porque nao compila.

Deem uma olhada:

Код:
#include <a_samp>
#include <dini>

//Defines
#define SKINS Skins/%s.ini

SalvarSkin(playerid,skinid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	new String[90];
	format(String, sizeof(String), SKINS, name);
	dini_IntSet(String,"Skin",GetPlayerSkin(playerid);
	return 1;
}

CarregarSkin(playerid,skinid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	new String[90]
	format(String, sizeof(String), CONTAS, Nome);
	SetPlayerSkin(playerid, dini_Int(String,"Skin"));
	return 1;
}

public OnPlayerSpawn(playerid)
{
	CarregarSkin(playerid,skinid);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SalvarSkin(playerid,skinid));
    return 1;
}

public OnGameModeExit()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    SalvarSkin(i);
    return 1;
}
E aqui o erro:

Код:
C:\Users\Usuario\Desktop\salvandoskin.pwn(12) : error 017: undefined symbol "Skins"
C:\Users\Usuario\Desktop\salvandoskin.pwn(12) : error 017: undefined symbol "s"
C:\Users\Usuario\Desktop\salvandoskin.pwn(12) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\salvandoskin.pwn(12) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Por favor, me ajudem.
Reply
#2

Falta fechar parenteses do dini_intset....
Reply
#3

pawn Код:
#include <a_samp>
#include <dini>

//Defines
#define SKINS "Skins/%s.ini"

SalvarSkin(playerid,skinid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new String[90];
    format(String, sizeof(String), SKINS, name);
    dini_IntSet(String, "Skin", GetPlayerSkin(playerid));
    return 1;
}

CarregarSkin(playerid,skinid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new String[90]
    format(String, sizeof(String), CONTAS, Nome);
    SetPlayerSkin(playerid, dini_Int(String,"Skin"));
    return 1;
}

public OnPlayerSpawn(playerid)
{
    CarregarSkin(playerid,skinid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SalvarSkin(playerid,skinid));
    return 1;
}

public OnGameModeExit()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    SalvarSkin(i);
    return 1;
}
Reply
#4

fiz essas alteracoes:

Код:
#include <a_samp>
#include <dini>

//Defines
#define SKINS "Skins/%s.ini"

SalvarSkin(playerid,skinid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new String[90];
    format(String, sizeof(String), SKINS, name);
    dini_IntSet(String, "Skin", GetPlayerSkin(playerid));
    return 1;
}

CarregarSkin(playerid,skinid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new String[90]
    format(String, sizeof(String), SKINS, Nome);
    SetPlayerSkin(playerid, dini_Int(String,"Skin"));
    return 1;
}

public OnPlayerSpawn(playerid)
{
    CarregarSkin(playerid,skinid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	SalvarSkin(playerid,skinid);
	return 1;
}
E da esses erros:

Код:
C:\Users\Usuario\Desktop\salvandoskin.pwn(7) : warning 203: symbol is never used: "skinid"
C:\Users\Usuario\Desktop\salvandoskin.pwn(22) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Usuario\Desktop\salvandoskin.pwn(22) : error 017: undefined symbol "Nome"
C:\Users\Usuario\Desktop\salvandoskin.pwn(17) : warning 203: symbol is never used: "skinid"
C:\Users\Usuario\Desktop\salvandoskin.pwn(29) : error 017: undefined symbol "skinid"
C:\Users\Usuario\Desktop\salvandoskin.pwn(35) : error 017: undefined symbol "skinid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#5

Muito melhor assim, mais simples e otimizado

pawn Код:
#include <a_samp>
#include <dini>

//Defines
#define SKINS "Skins/%s.ini"

// variaveis globais, topoda gm/fs
new skinid = GetPlayerSkin(playerid);
new String[90];

public OnPlayerSpawn(playerid)
{
    format(String, sizeof(String), SKINS, PlayerName(playerid));
    SetPlayerSkin(playerid, dini_Int(String,"Skin"));
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    format(String, sizeof(String), SKINS, PlayerName(playerid));
    dini_IntSet(String, "Skin", skinid);
    return 1;
}

stock PlayerName(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    return pname;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)