SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/07/2018, 10:02 AM   #1
BrainDamaged
Big Clucker
 
BrainDamaged's Avatar
 
Join Date: Jun 2016
Posts: 109
Reputation: 0
Default MySQL - Check Register

Hi, if you try to use the registered players command, you will get an error saying that you are not registered. How can i solve the problem ?


Code:
CMD:changeques(playerid, params[])
{
	if (eUser[playerid][e_USER_SQLID] != 1)
	{
		SendClientMessage(playerid, COLOR_TOMATO, "Only registered users can use this command.");
		return 1;
	}

    new list[2 + (sizeof(SECURITY_QUESTIONS) * MAX_SECURITY_QUESTION_SIZE)];
	for (new i; i < sizeof(SECURITY_QUESTIONS); i++)
	{
	    strcat(list, SECURITY_QUESTIONS[i]);
	    strcat(list, "\n");
	}
	ShowPlayerDialog(playerid, CHANGE_SEC_QUESTION, DIALOG_STYLE_LIST, "Change account security question... [Step: 1/2]", list, "Continue", "Cancel");
	SendClientMessage(playerid, COLOR_WHITE, "[Step: 1/2] Select a security question. This will help you retrieve your password in case you forget it any time soon!");
	PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
	return 1;
}
BrainDamaged is offline   Reply With Quote
Old 12/07/2018, 10:26 AM   #2
Calisthenics
Huge Clucker
 
Join Date: May 2018
Posts: 276
Reputation: 48
Default Re: MySQL - Check Register

I just checked the code from Gammix's gamemode and resetting value for e_USER_SQLID is -1. Therefore:
pawn Code:
if (eUser[playerid][e_USER_SQLID] != -1)
Calisthenics is offline   Reply With Quote
Old 12/07/2018, 10:38 AM   #3
BrainDamaged
Big Clucker
 
BrainDamaged's Avatar
 
Join Date: Jun 2016
Posts: 109
Reputation: 0
Default Re: MySQL - Check Register

I changed the problem like this

Code:
if (!GetPVarInt(playerid, "LoggedIn"))
is it true ?
BrainDamaged is offline   Reply With Quote
Old 12/07/2018, 02:11 PM   #4
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 744
Reputation: 39
Default Re: MySQL - Check Register

This checks if the player is logged in tho.. (If you already set a variable integer of logging in to the player to 1) I guess you need to know if the player is registered or no, By checking if his SQLID is a valid row id in the accounts table.. valid ID = not equal -1..
__________________


Discord: Riggs #5210
JasonRiggs is offline   Reply With Quote
Old 12/07/2018, 08:13 PM   #5
BrainDamaged
Big Clucker
 
BrainDamaged's Avatar
 
Join Date: Jun 2016
Posts: 109
Reputation: 0
Default Re: MySQL - Check Register

Quote:
Originally Posted by JasonRiggs View Post
This checks if the player is logged in tho.. (If you already set a variable integer of logging in to the player to 1) I guess you need to know if the player is registered or no, By checking if his SQLID is a valid row id in the accounts table.. valid ID = not equal -1..

Thank you for the information
BrainDamaged is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL Ban Check theonethatownz Scripting Help 1 25/03/2016 07:18 PM
MYSQL Check Ban Help Blademaster680 Scripting Help 1 01/07/2014 08:55 PM
Mysql queriesYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for th audriuxxx Scripting Help 4 11/04/2014 06:42 PM
[HELP] mysql check V4at Scripting Help 10 25/02/2014 07:52 PM
Register / Login - MySQL Check Player nGen.SoNNy Scripting Help 4 22/09/2012 05:14 PM


All times are GMT. The time now is 05:17 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.