22.11.2013, 19:35
Yeah I noticed, but only after I posted that.. therefor the edit :P
Anyways, I have one more question (note: here comes the question that proves I'm a total starter in this scripting/programming).
I have a function that creates the login screen:
Now I would like to create the logout command, except I have no idea how I make it return to the public OnPlayerConnect(playerid) function.
I tried return OnPlayerConnect, but that doesn't work... My simplistic brain
Anyways, I have one more question (note: here comes the question that proves I'm a total starter in this scripting/programming).
I have a function that creates the login screen:
Код:
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(); new rows = mysql_num_rows(); printf("There are %s rows in table1",rows); if(mysql_num_rows() ==1) { SendClientMessage(playerid, -1, "That username is registered!"); ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "Login", "Please login with the password you made", "Login", "Cancel"); } else { SendClientMessage(playerid, -1, "That username is not registered. You may register it"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Register", "Please enter a password for your account", "Register", "Cancel"); } return 1; }
I tried return OnPlayerConnect, but that doesn't work... My simplistic brain

Код:
CMD:logout(playerid) { return 1; }