SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/12/2017, 04:20 PM   #1
GlorifiedPig
Little Clucker
 
Join Date: Aug 2015
Posts: 21
Reputation: 3
Default Problem with loading SQL

So saving my SQL works perfectly fine. But when I load it in it adds the number 48 to each var (except the password, username and money vars). For the money, it makes it some random number, most noticeably 57. I don't understand what I did wrong. They're all integers.

Code:
stock LoginPlayer( playerid )
{
	new query[128], 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();
	
	while( mysql_fetch_row_format( query, "|" ) ) {
	    mysql_fetch_field_row( Player[playerid][Name], "Name" );
	    mysql_fetch_field_row( Player[playerid][Password], "Password" );
	    mysql_fetch_field_row( Player[playerid][Kills], "Kills" );
	    mysql_fetch_field_row( Player[playerid][Deaths], "Deaths" );
	    mysql_fetch_field_row( Player[playerid][AdminLvl], "AdminLvl" );
	    mysql_fetch_field_row( Player[playerid][Money], "Money" );
	}
	
	GivePlayerMoney( playerid, Player[playerid][Money] );
}
GlorifiedPig is offline   Reply With Quote
Old 03/01/2018, 09:29 PM   #2
GlorifiedPig
Little Clucker
 
Join Date: Aug 2015
Posts: 21
Reputation: 3
Default Re: Problem with loading SQL

Bump
GlorifiedPig is offline   Reply With Quote
Old 10/01/2018, 09:49 AM   #3
GlorifiedPig
Little Clucker
 
Join Date: Aug 2015
Posts: 21
Reputation: 3
Default Re: Problem with loading SQL

Bump
GlorifiedPig is offline   Reply With Quote
Old 10/01/2018, 09:56 AM   #4
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,526
Reputation: 554
Default Re: Problem with loading SQL

Show your table structure and enum used by Player.
Misiur is offline   Reply With Quote
Old 10/01/2018, 04:41 PM   #5
GlorifiedPig
Little Clucker
 
Join Date: Aug 2015
Posts: 21
Reputation: 3
Default Re: Problem with loading SQL

Quote:
Originally Posted by Misiur View Post
Show your table structure and enum used by Player.
Code:
enum PlayerStats {
	Name[128],
	Password[128],
	Kills,
	Deaths,
	AdminLvl,
	Money,
}
new Player[MAX_PLAYERS][PlayerStats];
GlorifiedPig 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
loading problem lulo356 Scripting Help 7 16/12/2015 10:11 PM
Loading problem (+rep) streetpeace Scripting Help 6 25/09/2014 10:54 AM
SA-MP loading problem. Xenzia Client Support 11 24/03/2014 12:18 AM
CAR LOADING PROBLEM. budelis Help Archive 5 30/06/2011 06:17 PM
Loading Problem zxc1 Help Archive 3 27/04/2011 03:21 PM


All times are GMT. The time now is 07:04 AM.


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