22.07.2010, 11:02
Hello everyone,
I'm busy with a gamemode from scratch. It is going to be a RolePlay server, and everything is based on MySQL. I maded a function to get a value from the users table. The problem is: No errors while compiling, but the script doesn't work!
So, in the script I use the function like this:
But, it doesn't work, I don't get a value from the function.
It's driving me crazy! Please help.
Thanks for now!
Bas
I'm busy with a gamemode from scratch. It is going to be a RolePlay server, and everything is based on MySQL. I maded a function to get a value from the users table. The problem is: No errors while compiling, but the script doesn't work!
Код:
public GetUserValue(playerid, qrow[])
{
new playername[500];
new qresult[500];
new qresult2;
GetPlayerName(playerid, playername, sizeof(playername));
format(query, sizeof(query), "SELECT '%s' FROM users WHERE username='%s' LIMIT 1", qrow, playername);
samp_mysql_query(query);
samp_mysql_store_result();
samp_mysql_fetch_row(qresult);
qresult2 = strval(qresult);
return qresult2;
}
Код:
public OnPlayerSpawn(playerid)
{
GivePlayerMoney(playerid, GetUserValue(playerid, "money"));
return 1;
}
It's driving me crazy! Please help.
Thanks for now!
Bas

