11.02.2011, 12:12
code:
errors:
PHP код:
#pragma unused ret_memcpy
#include <a_samp>
#include <dini>
#include <dudb>
#define COLOR_YELLOW 0xFFFF00AA
enum pInfo
{
pAdminLevel,
pCash,
pScore,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];
#define SERVER_USER_FILE "Register_Dialog/Users/%s.ini"
public OnPlayerConnect(playerid)
{
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 you are not registered", "Welcome, you are not registered. to register please input your registration password below", "Register", "Leave");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi you are registered", "you are already registered. to login please Inpute your password below", "Login", "Leave");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
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;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
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 you are not registered", "Welcome, you are not registered. to register please input your registration password 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 you are registered", "you are already registered. to login please Inpute your password below", "Login", "Leave");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, COLOR_RED, "You entered the wrong password.");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi you are registered", "you are already registered. to login please Inpute your password 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!");
}
}
return 0;
}
PHP код:
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(28) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(280) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(298) : warning 219: local variable "tmp" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(337) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(379) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dutils.inc(462) : warning 219: local variable "tmp" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\pawno\include\dini.inc(46) : warning 219: local variable "tmp" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(19) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(19) : warning 219: local variable "name" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(19) : warning 219: local variable "file" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(30) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(35) : warning 219: local variable "name" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(35) : warning 219: local variable "file" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(36) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(45) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(51) : warning 219: local variable "name" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(51) : warning 219: local variable "file" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(51) : warning 219: local variable "string" shadows a variable at a preceding level
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(67) : warning 209: function "OnDialogResponse" should return a value
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(67) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(70) : error 021: symbol already defined: "GetPlayerName"
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(72) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(73) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(75) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(76) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(80) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(91) : error 010: invalid function or declaration
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(94) : warning 203: symbol is never used: "file"
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(94) : warning 203: symbol is never used: "name"
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(94) : warning 203: symbol is never used: "string"
D:\gta san andreas online\Godfucker\My Fs\Register System - Dialog\Register_Dialog.pwn(94) : warning 203: symbol is never used: "tmp"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
8 Errors.