19.06.2016, 09:13
(
Последний раз редактировалось ChristolisTV; 19.06.2016 в 16:05.
Причина: Solved..
)
Hello again! I am trying to create an admin system but I get some errors.
Every error is located on OnDialogResponse. Here it is:
Help please it's really important
Код:
C:\Users\Chris\Desktop\Personal Folder\Servers\GTA SAMP DreamLand [Public]\filterscripts\AccSys.pwn(135) : warning 202: number of arguments does not match definition C:\Users\Chris\Desktop\Personal Folder\Servers\GTA SAMP DreamLand [Public]\filterscripts\AccSys.pwn(163) : warning 202: number of arguments does not match definition C:\Users\Chris\Desktop\Personal Folder\Servers\GTA SAMP DreamLand [Public]\filterscripts\AccSys.pwn(163) : error 039: constant symbol has no size C:\Users\Chris\Desktop\Personal Folder\Servers\GTA SAMP DreamLand [Public]\filterscripts\AccSys.pwn(164) : warning 202: number of arguments does not match definition C:\Users\Chris\Desktop\Personal Folder\Servers\GTA SAMP DreamLand [Public]\filterscripts\AccSys.pwn(164) : error 039: constant symbol has no size Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(!(5 <= strlen(inputtext) <= 20))
{
SendClientMessage(playerid,0xFFFFFFFF, "{33CCCC}DreamLand:{FFFFFF} Your password has to be between 5-20 characters");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Welcome to DreamLand!\n\nType your password below to register your account:", "Register", "Cancel");
return 1;
}
new
q[208];
WP_Hash(User[playerid][P_PASSWORD], 129, inputtext);
format(q, sizeof(q),"INSERT INTO Accounts (username, password) VALUES ('%q', '%s')",User[playerid][P_NAME], User[playerid][P_PASSWORD]);
db_query(Database, q);
SendClientMessage(playerid, -1, "{33CCCC}DreamLand:{FFFFFF} Thank you for registering on the server! It means a lot to us!");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
new
DBResult: Result;
Result = db_query(Database, "SELECT last_insert_rowid()");
User[playerid][P_ID] = db_get_field_assoc_int(Result);
db_free_result(Result);
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
new
buf[129];
WP_Hash(buf, 129, inputtext);
if(strcmp(buf, User[playerid][P_PASSWORD]))
{
SendClientMessage(playerid, -1, "{33CCCC}DreamLand:{FFFFFF} Incorrect password, try again!");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Welcome back!\n\nType your password below to login with your account:", "Login", "Cancel");
return 1;
}
new
DBResult: Result;
format(buf, sizeof(buf), "SELECT * FROM Accounts WHERE username = '%q' LIMIT 1", User[playerid][P_NAME]);
Result = db_query(Database, buf);
if(db_num_rows(Result))
{
User[playerid][P_ID] = db_get_field_assoc_int(Result, "userid", P_ID, sizeof P_ID);
User[playerid][P_RANK] = db_get_field_assoc_int(Result, "admin", P_RANK, sizeof P_RANK);
SendClientMessage(playerid, -1, "{33CCCC}DreamLand:{FFFFFF} Welcome back and have fun!");
}
db_free_result(Result);
}
default: return 0;
}
return 1;
}