Values
#1

Hello

I have a problem
Code:
if (strcmp(cmd, "/stats", true) == 0)
	{
	  new query[500];
	  GetPlayerName(playerid,pName,sizeof(pName));
	  format(query,sizeof(query),"SELECT * FROM `"TABLENAME"` WHERE Username = '%s' LIMIT 1",pName);
	  mysql_query(query);
	  mysql_store_result();
	  new money[32], skin[32], bank[32], paycheck[32];
	  new faction[32], rank[32], job[32], number[32], deaths[32];
    new level[32], exp[32], donator[32], hourson[32];
		mysql_fetch_field_row(money, "Money");
		mysql_fetch_field_row(skin, "Skin");
		mysql_fetch_field_row(bank, "Bank");
		mysql_fetch_field_row(paycheck, "Paycheck");
		mysql_fetch_field_row(faction, "Member");
		mysql_fetch_field_row(rank, "Rank");
		mysql_fetch_field_row(job, "Job");
		mysql_fetch_field_row(number, "Number");
		mysql_fetch_field_row(deaths, "Deaths");
 		mysql_fetch_field_row(level, "Level");
		mysql_fetch_field_row(exp, "Experience");
		mysql_fetch_field_row(donator, "Donate");
		mysql_fetch_field_row(hourson, "HoursOn");
		new tdonate[32];
		if(strval(donator)==0){tdonate = "None";}
		else if(strval(donator)==1){tdonate = "Bronze";}
		else if(strval(donator)==2){tdonate = "Silver";}
		else if(strval(donator)==3){tdonate = "Gold";}
		new tjob[32];
		if(strval(job)==0){tjob = "None";}
		new trank[32];
		if(strval(rank)==0){trank = "None";}
		new tfaction[32];
		if(strval(faction)==0){tfaction = "None";}
		format(string,sizeof(string),"| Character | Skin: [%d] - Faction: [%s] - Rank: [%s] - Job: [%s] - PhoneNo: [%d] - Deaths: [%d/10] |",strval(skin),tfaction,trank,tjob,strval(number),strval(deaths));
		SendClientMessage(playerid,COLOR_WHITE,string);
		format(string,sizeof(string),"| Money | Cash: [%d] - Bank: [%d] - PayCheck: [%d] |",strval(money),strval(bank),strval(paycheck));
		SendClientMessage(playerid,COLOR_WHITE,string);
		format(string,sizeof(string),"| Level | PlayerLevel: [%d] - Experience: [%d] - DonatorLevel: [%s] - HoursOn: [%d] |",strval(level),strval(exp),tdonate,strval(hourson));
		SendClientMessage(playerid,COLOR_WHITE,string);
		return 1;
	}
and ingame it says
Code:
| Character | Skin: [0] - Faction: [] - Rank: [None] - Job: [None] - PhoneNo: [0] - Deaths: [0/10] |		
| Money | Cash: [0] - Bank: [0] - PayCheck: [0] |
| Level | PlayerLevel: [0] - Experience: [0] - DonatorLevel: [None] - HoursOn: [0] |
but in the mysql there a vaules..


Reply
#2

Are the values in the database 0?
Reply
#3

Quote:
Originally Posted by _Xerxes_
Are the values in the database 0?
no, there

in db the.

donate is 3
admin is 4
money is like 1000
bank 200
level 1
skin 116
Reply
#4

*bump* anyone?
Reply
#5

I think this one is gonna help you: http://forum.sa-mp.com/index.php?top...2943#msg802943
Reply
#6

Quote:
Originally Posted by SAWC™
I think this one is gonna help you: http://forum.sa-mp.com/index.php?top...2943#msg802943
Thanks dont help me, his problem was he was using PHP in pawno lol

So can someone help me
Reply
#7

I think, you shouldn't use arrays for integer values, and things will become much simple then.
Like money[32], bank[32], etc <- those should be integers or else there's a waste of memory + the need of using strval

And also, fetching all fields one by one is a more resource consuming job than fetching all result at once and then split it by a delimiter.
Reply
#8

Quote:
Originally Posted by Sma_X
I think, you shouldn't use arrays for integer values, and things will become much simple then.
Like money[32], bank[32], etc <- those should be integers or else there's a waste of memory + the need of using strval

And also, fetching all fields one by one is a more resource consuming job than fetching all result at once and then split it by a delimiter.
the way im doing it is the easyest way to do it

i know whats whats wrong

im using
Code:
mysql_fetch_field_row();
wrong

But none is samp is kind anoth to help, becuase there all t**ts that only think about them selfs
eg: i send 2 pms to the owner of the mysql plugin and he just dont give a flying f***

sorry if im geting mody
Reply
#9

*dump*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)