Hello everyone. I'm seeking your help since I cannot figure out the following issue. I've recently started to learn scripting once more since a had a break since 0.1 of SAMP. And I'm completely lost. I used a ******* tutorial and followed along, trying to learn on how to make the basics of a MySQL Login/Register system. But after doing so it gives me the following errors. Here's my includes code with the errors. I hope you can help me and that I am not a pest, trying to learn. Thanks!
Код:
public OnPlayerConnect(playerid)
{
new query[126], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(query, sizeof(query), "SELECT * FROM accounts where Name = '%s'", pName);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SendClientMessage(playerid, -1, "That username is registered already!");
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Login", "Please login with the password you made", "Login", "Cancel");
}
else
return SendClientMessage(playerid, -1, "That username is not registered. You may register it!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Please enter a password you will remember", "Register", "Cancel");
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 * FROM accounts WHERE name = '%s' AND password = '%s'", pName, inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SendClientMessage(playerid, -1, "You have successfully signed in!");
SpawnPlayer(playerid);
}
else
(
SendClientMessage(playerid, -1, "Incorrect password!"
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Login", "Please login with the password you made", "Login", "Cancel");
}
}
}
case 1:
{
if(response)
{
new query[126], pName[MAX_PLAYER_NAME]
GetPlayerName(playerid, pName, sizeof{pName));
format(query, sizeof(query), "INSTERT INTO accounts VALUES ('%s', '%s')", pName, inputtext);
mysql_query(query);
SendClientMessage(playerid, -1, "You have registered!");
SpawnPlayer(playerid);
}
}
}
return 1;
}
Shameless self bump. Anyone?
SO about the rest please point out the lines.. Thank you!