16.07.2011, 15:24
Код:
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(27) : error 001: expected token: "-identifier-", but found "new" C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(28) : error 017: undefined symbol "gPlayerLogged" C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(28) : error 017: undefined symbol "playerid" C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(28) : error 029: invalid expression, assumed zero C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(28) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Код:
#include <dudb> #include <dutils> #include <Dini> #pragma tabsize 0 #define TEAM_Party 1 #define TEAM_Guard 2 #define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format) #define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple #define SERVER_USER_FILE "myserver/%s.ini" #define PlayerInfo[MAX_PLAYERS][pInfo]; #define gPlayerLogged[MAX_PLAYERS]; public OnGameModeInit() { enum pInfo { pAdminLevel, pCash, pScore, } new gPlayerLogged[MAX_PLAYERS]; new PlayerInfo[MAX_PLAYERS][pInfo]; gPlayerLogged[playerid] = 0; new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if (!dini_Exists(file)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, input your registration pw below", "Register", "Leave"); } if(fexist(file)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave"); } new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(gPlayerLogged[playerid] == 1) { dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]); dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); } gPlayerLogged[playerid] = 0; if (dialogid == 1) { new name[MAX_PLAYER_NAME], file[256], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, input your registration pw below", "Register", "Leave"); dini_Create(file); dini_IntSet(file, "Password", udb_hash(inputtext)); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0); dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500); dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0); format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s, you have been auto logged in.", name, inputtext); SendClientMessage(playerid, COLOR_YELLOW, string); gPlayerLogged[playerid] = 1; } if (dialogid == 2) { new name[MAX_PLAYER_NAME], file[256], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave"); new tmp; tmp = dini_Int(file, "Password"); if(udb_hash(inputtext) != tmp) { SendClientMessage(playerid, COLOR_RED, "Wrong PW sir."); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave"); } else { gPlayerLogged[playerid] = 1; PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); SetPlayerScore(playerid, PlayerInfo[playerid][pScore]); GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid)); SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!"); } }