|Mysql Register\Login Sistem Done[4Errors] Help| -
zabac97 - 04.04.2015
Hello im working on Login And Register sistem with Mysql and ive finished but i have errors .Down there is code and errors , Thanks for help i prishied.
Prijava-Login
Odustani-Cancle
errors are
(52) : warning 215: expression has no effect
(53) : error 029: invalid expression, assumed zero
(53) : error 001: expected token: ")", but found ";"
(53 -- 55) : warning 215: expression has no effect
(55) : error 001: expected token: ";", but found "if"
(55) : fatal error 107: too many error messages on one line
Includes and Defines are
#include <a_samp>
#include <sscanf2>
#include <a_mysql>
If i remove this erorr shows , that need to define all of 3 but if i define only first 2 #define mysql_num_rows
dont need to define why ? He told me that need to define all of 3 but its ok to define only 2 pls help ?
#define mysq_query
#define mysql_store_result
#define mysql_num_rows
//================================================== ===================
Код:
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
mysql_connect("localhost", "root", "server", "");
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
//======
public OnPlayerConnect(playerid)
{
new query[124], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(query, sizeof(query), "SELECT * FROM accounts WHERE name = '%s'", pName);
mysq_query(query); -line 50error
mysql_store_result(); -line 51error
if(mysql_num_rows() == 1) -line 53 error
{
SendClientMessage(playerid, -1, "Thats username is registred!");
ShowPlayerDialog(playerid, 0,DIALOG_STYLE_INPUT, "Prijava", "Please login with ur password u made", "Prijava", "Odustani");
}
else
{
SendClientMessage(playerid, -1, "Thats username is not registred, u may register!");
}
return 1;
}
//==========
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 0:
{
if(response)
{
new query[126], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof[pName]);
format(query, sizeof(query), "SELECT password FROM accounts WHERE name = '%s' AND password = '%s'", pName, inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_nun_rows() == 1)
{
SendClientMessage(playerid, -1, "You have successfully signed in!)';
SetSpawnInfo(playerid, 1, 299, 1, 2, 3, 1, 1, 999, 1, 999, 1, 999);
SpawnPlayer(playerid);
}
else
{
SendClientMesage(playerid, -1, "Incorrect Password");
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Prijava", "Please login with the password u made", "Prijava", "Odustani");
}
}
}
case 1:
{
if(response)
}
new query[126], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof[pName]);
format(query, sizeof(query), "INSERT INTO accounts VALUES ('%s', '%s', pName, inputtext)
mysql_query(query);
SendClientMessage(playerid, -1, "You have registred!");
SetSpawnInfo(playerid, 1, 299, 1, 2, 3, 1, 1, 999, 1, 999, 1, 999);
}
}
}
return 1;
}
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
zabac97 - 04.04.2015
Im newbie and im looking for partner to help me , i realy wont to learn how to screapt but i cant alone im serbian and i know eng good but still thats not it , if some1 wont to help me pls pm me . Thanks to all <3.
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
Matess - 04.04.2015
Delete DEFINES! It should be in a_samp but idk what you got there.
Код HTML:
mysq_query change on mysql_query
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
zabac97 - 04.04.2015
Dude on white line to put but when i delete defines pawno saying that i need to define it dont know why
Can u help me to learn to work pls if thats not a problem this is all new about me i know simple things but i wont to learn more , i have book and im ready to learn xD . ??
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
zabac97 - 04.04.2015
I dont know what is this forum for cuz no 1 help , im nebie and i dont know how to learn cuz no 1 wont to help, im asking just for litle explanation with pawno and commands code .If u cant help then shut down this forum ...
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
biker122 - 04.04.2015
You are using an outdated mysql version. (R5 - R6) You have to get that version to make the script work/compile.
AW: |Mysql Register\Login Sistem Done[4Errors] Help| -
Mencent - 04.04.2015
Hello!
First you should upgrade your MySQL version to r39-3.
Then you test your code again. If you have problems post it and we can help you.
Best regards,
Mencent
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
zabac97 - 04.04.2015
Okej i registred i will update it can u maybe send me link of lates version but i think i download last...
Re: |Mysql Register\Login Sistem Done[4Errors] Help| -
zabac97 - 04.04.2015
Yes i have r39.3 version of mysql :/
AW: |Mysql Register\Login Sistem Done[4Errors] Help| -
Mencent - 04.04.2015
https://github.com/pBlueG/SA-MP-MySQL/releases
Mencent