03.08.2013, 06:53
Hello, i got a little problem.
But when i try to compile it gives me the following errors
Please Help
pawn Код:
#include <a_samp>
#include <YSI\y_ini>
#include "../include/gl_common.inc"
#define TEAM_POLITIE 1
#define TEAM_TRIAD 2
#define TEAM_MUNCITOR 3
#define TEAM_HITMAN 4
#define COLOR_ROSU 0xFF0000FF
#define COLOR_ALBASTRU 0x0000FFFF
#define COLOR_GRI 0x808080FF
#define COLOR_GALBEN 0xFFFF00FF
#define COLOR_ALB 0xFFFFFFFF
#define COLOR_ALB_EMBED "{FFFFFF}"
#define COLOR_ROSU_EMBED "{F81414}"
#define COLOR_VERDE_EMBED "{00FF22}"
#define COLOR_GALBEN_EMBED "{00CED1}"
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define PATH "/tdmd/users/%s.ini"
new total_vehicles_from_files=0;
new gTeam[MAX_PLAYERS];
main()
{
print("TDM D v1.0 Loaded - Succes");
}
public OnGameModeInit()
{
SetGameModeText("TDM D v1.0");
//Classid 0,1 - POLITIE
AddPlayerClass(286,-1590.1783,716.3723,-5.2422,271.5280,WEAPON_KNIFE,1,WEAPON_COLT45,0x7FFFFFFF,WEAPON_TEC9,0x7FFFFFFF);
AddPlayerClass(281,-1606.2870,676.0802,-5.2422,359.2622,WEAPON_KNIFE,1,WEAPON_COLT45,0x7FFFFFFF,WEAPON_TEC9,0x7FFFFFFF);
//Classid 2,3 - TRIAD
AddPlayerClass(117,-2190.3599,641.3010,49.4375,88.5436,WEAPON_BAT,1,WEAPON_COLT45,0x7FFFFFFF,WEAPON_UZI,0x7FFFFFFF);
AddPlayerClass(120,-2189.8606,608.9390,35.1641,86.6636,WEAPON_BAT,1,WEAPON_COLT45,0x7FFFFFFF,WEAPON_UZI,0x7FFFFFFF);
//Classid 4,5 - MUNCITOR
AddPlayerClass(27,-2084.1450,229.6412,35.6909,268.0180,WEAPON_KNIFE,1, WEAPON_COLT45,0x7FFFFFFF,WEAPON_TEC9, 0x7FFFFFFF);
AddPlayerClass(260,-2026.6230,179.5202,28.8359,278.3814,WEAPON_KNIFE,1, WEAPON_COLT45,0x7FFFFFFF,WEAPON_TEC9, 0x7FFFFFFF);
//Classid 6,7 - HITMAN
AddPlayerClass(185,-1660.3741,1384.4176,9.8047,134.6696,WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF);
AddPlayerClass(186,-1678.8684,1355.5388,7.1722,52.5988,WEAPON_BAT, 1, WEAPON_COLT45, 0x7FFFFFFF, WEAPON_UZI, 0x7FFFFFFF);
total_vehicles_from_files += LoadStaticVehiclesFromFile("tdmd/masini.txt");
return 1;
}
public OnGameModeExit()
{
return 1;
}
//Setare Pozitie Alegere Echipe + Setari Echipa
public OnPlayerRequestClass(playerid,classid)
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid,-2651.0171,1410.2346,906.2734);
SetPlayerFacingAngle(playerid,90.3552);
SetPlayerCameraPos(playerid,-2646.0171,1410.2346,906.2734);
SetPlayerCameraLookAt(playerid,-2651.0171,1410.2346,906.2734);
SetPlayerFacingAngle (playerid,270.3552);
switch(classid)
{
case 0,1:
{
GameTextForPlayer(playerid,"~b~politie",3000,6);
SetPlayerTeam(playerid,TEAM_POLITIE);
gTeam[playerid] = TEAM_POLITIE;
SetPlayerColor(playerid,COLOR_ALBASTRU);
}
case 2,3:
{
GameTextForPlayer(playerid,"~r~triad",3000,6);
SetPlayerTeam(playerid, TEAM_TRIAD);
gTeam[playerid] = TEAM_TRIAD;
SetPlayerColor(playerid, COLOR_ROSU);
}
case 4,5:
{
GameTextForPlayer(playerid,"~y~muncitor",3000,6);
SetPlayerTeam(playerid,TEAM_MUNCITOR);
gTeam[playerid] = TEAM_MUNCITOR;
SetPlayerColor(playerid,COLOR_GALBEN);
}
case 6,7:
{
GameTextForPlayer(playerid, "~w~hitman",3000,6);
SetPlayerTeam(playerid,TEAM_HITMAN);
gTeam[playerid] = TEAM_HITMAN;
SetPlayerColor(playerid,COLOR_GRI);
}
}
return 1;
}
//Setare Culoare Echipa
SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_POLITIE)
{
SetPlayerColor(playerid,COLOR_ALBASTRU);
}
else if (gTeam[playerid] == TEAM_TRIAD)
{
SetPlayerColor(playerid,COLOR_ROSU);
}
else if (gTeam[playerid] == TEAM_MUNCITOR)
{
SetPlayerColor(playerid,COLOR_GALBEN);
}
else if (gTeam[playerid] == TEAM_HITMAN)
{
SetPlayerColor(playerid,COLOR_GRI);
}
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_ALB_EMBED"Login",""COLOR_ALB_EMBED"Scrie parola mai jos pentur a te loga.","Login","Iesi");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_ALB_EMBED"Inregistrare...",""COLOR_ALB_EMBED"Scrie parola mai jos pentru a inregistra un nou account.","Register","Iesi");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File,"Casa",PlayerInfo[playerid][pCasa]);
INI_WriteInt(File,"Banca",PlayerInfo[playerid][pBanca]);
INI_Close(File);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COLOR_ALB_EMBED"Inregistrare...",""COLOR_ROSU_EMBED"Ai introdus o parola invalida.\n"COLOR_ALB_EMBED"Scrie parola mai jos pentru a inregistra un nou account.","Register","Iesi");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Level",0);
INI_WriteInt(File,"Casa",0);
INI_WriteInt(File,"Banca",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COLOR_ALB_EMBED"Success!",""COLOR_GALBEN_EMBED"Minunat! Relogeaza-te pentru a salva stats-urile.","Ok","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COLOR_ALB_EMBED"Success!",""COLOR_VERDE_EMBED"Te-ai logat cu succes!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_ALB_EMBED"Login",""COLOR_ROSU_EMBED"Ai introdus o parola incorecta.\n"COLOR_ALB_EMBED"Scrie parola mai jos pentru a te loga.","Login","Iesi");
}
return 1;
}
}
}
return 1;
}
//Stats pentru Login System
enum pInfo
{
pPassword,
pCash,
pAdmin,
pKills,
pDeaths,
pLevel,
pCasa,
pBanca
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPassword]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Level",PlayerInfo[playerid][pLevel]);
INI_Int("Casa",PlayerInfo[playerid][pCasa]);
INI_Int("Banca",PlayerInfo[playerid][pBanca]);
return 1;
}
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
//Hasher
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
pawn Код:
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(152) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(153) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(154) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(155) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(156) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(157) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(172) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(173) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(210) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\TEST\pawno\tdmd.pwn(213) : error 017: undefined symbol "PlayerInfo"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
10 Errors.