- 0
Erori sistem logare
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
thestafy
primesc urmatoarele erori:
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(14) : error 001: expected token: ";", but found "enum"
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(37) : warning 213: tag mismatch
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(57) : warning 213: tag mismatch
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(57) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(57) : error 001: expected token: ";", but found ")"
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(57) : error 029: invalid expression, assumed zero
C:\Users\Daniel\Desktop\svsamp\gamemodes\Gamemode_v1.0.pwn(57) : fatal error 107: too many error messages on one line
are cineva idee?
aici este si scriptul:
#include <a_samp>
#include <a_mysql>
new SQL = -1, gQuery[256], gString[256];
#define function%0(%1) forward %0(%1); public %0(%1)
#define SCM SendClientMessage
#define COLOR_DARKRED 0XD80003FF
new
incercariParola[MAX_PLAYERS]
enum pInfo {
pSQLID,
pName[MAX_PLAYER_NAME],
pPassword[32],
pEmail[32],
pGender
}
new PlayerInfo[MAX_PLAYERS][pInfo];
enum {
//REGISTER
DIALOG_REGISTER,
DIALOG_EMAIL,
DIALOG_GENDER,
//LOGIN
DIALOG_LOGIN
}
main() { print("Se initiaza gamemodeul..."); }
public OnGameModeInit()
{
SQL = mysql_connect("localhos" , "root" , "sv" , "");
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid){
incercariParola[playerid] = 0;
gQuery[0] = EOS;
mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM 'users' WHERE 'Name' = '%s' LIMIT 1" GetName(playerid));
mysql_tquery(SQL, gQuery, "checkAccount" , "i" , playerid);
return 1;
}
public OnDialgResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch(dialogid) {
case DIALOG_REGISTER: {
if(!response)
return Kick(playerid);
if(strlen(inputtext) <4 || strlen(inputtext) > 32)
return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Scrie o parola pentru a iti crea contul:", "Select", "Cancel");
gQuery[0] = EOS;
mysql_format(SQL, gQuery, sizeof(qQuery), "INSERT INTO 'users' ('Name' , 'Password') VALUES ('%s' , '%s')" , GetName(playerid), inputtext);
mysql_tquery(SQL, gQuery, "insertAccount", "i" , playerid );
gString[0] = EOS;
format(gString, sizeof(gString), "Parola ta contine %d caractere." strlen(inputtext));
SCM(playerid, -1 , gString);
format(PlayerInfo[playerid][pPassword], 32 , inputtext);
ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "EMAIL", "Te rugam sa-ti setezi adresa de email:", "Select", "Cancel");
}
case DIALOG_EMAIL: {
if(!response)
return Kick(playerid);
if(strlen(inputtext) <4 || strlen(inputtext) > 32)
return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "EMAIL", "Te rugam sa-ti setezi adresa de email:", "Select", "Cancel");
gQuery[0] = EOS;
mysql_format(SQL, gQuery, sizeof(qQuery), "UPDATE 'Users' SET 'Email = '%s' WHERE 'ID' = '%d'" , inputtext, PlayerInfo[playerid][pSQLID]);
mysql_tquery(SQL, gQuery, "", "" );
gString[0] = EOS;
format(gString, sizeof(gString), "Email setat %s" strlen(inputtext));
SCM(playerid, -1 , gString);
format(PlayerInfo[playerid][pEmail], 32 , inputtext);
ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_MSGBOX, "GENDER", "Seteaza-ti sexul:", "Masculin", "Feminin");
}
case DIALOG_GENDER: {
switch(response) {
case 0: {
PlayerInfo[playerid][pGender] = 1;
SCM(playerid, -1, "Sexul ales este Feminin");
}
case 1: {
PlayerInfo[playerid][pGender] = 0;
SCM(playerid, -1, "Sexul ales este Masculin");
}
}
gQuery[0] = EOS;
mysql_format(SQL, gQuery, sizeof(qQuery), "UPDATE 'Users' SET 'Gender = '%d' WHERE 'ID' = '%d'" , PlayerInfo[playerid][pGender], PlayerInfo[playerid][pSQLID]);
mysql_tquery(SQL, gQuery, "", "" );
SpawnPlayer(playerid);
}
case DIALOG_LOGIN: {
if(!response)
return Kick(playerid);
mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM 'users' WHERE Name' = '%s' AND 'Password'='%s' LIMIT 1" GetName(playerid)inputtext);
mysql_tquery(SQL, gQuery, "onlogin" , "i" , playerid);
}
}
return 1;
}
function onlogin (playerid) {
switch(cache_num_rows()) {
case 0: {
incercariParola[playerid] ++;
gString[0] = EOS;
format(gString, sizeof(gString),"Parola incorecta! (%d/3 incercari ramase)", incercariParola[playerid]);
SCM(palyerid, COLOR_DARKRED, gString);
if(incercariParola[playerid] == 3) Kick(playerid);
else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Te rugam sa introduci parola contului tau:", "Select", "Cancel");
}
case 1: {
new
result[64];
PlayerInfo[playerid][pSQLID] = cache_get_row_content_int("0", "ID");
PlayerInfo[playerid][pGender] = cache_get_row_content_int("0", "Gender");
cache_get_field_content(0, "Name" , result); format(PLayerInfo[playerid][pName], MAX_PLAYER_NAME, result);
cache_get_field_content(0, "Password" , result); format(PLayerInfo[playerid][pPassword], 32, result);
cache_get_field_content(0, "Email" , result); format(PLayerInfo[playerid][pEmail], 32, result);
printf("%s (user: %d) s-a conectat. [Gender: %d, Name: %s, Password: %s, Email: %s]" , GetName(playerid), PlayerInfo[playerid][pSQLID], PlayerInfo[playerid][pGender],PlayerInfo[playerid][pPassword], PlayerInfo[palyerid][pEmail]);
}
}
return 1;
}
function insertAccount(playerid) {
PlayerInfo[playerid][pSQLID] = cache_insert_id();
printf("%s s-a inregistrat cu SQLID-ul #%d." , GetName(playerid),PlayerInfo[playerid][pSQLID]);
return 1;
}
function checkAccount(playerid) {
switch(cache_num_rows()) {
case 0; ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Scrie o parola pentru a iti crea contul:", "Select", "Cancel");
case 1;ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Te rugam sa introduci parola contului tau:", "Select", "Cancel");
}
return 1;
}
stock GetName(playerid) {
Edited by thestafynew playerName[MAX_PALYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
return playerName;
}
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now