MySQL Help...
#1

So basically... I've started a scratch gamemode from SAM[P]CE..
And implemented a login/registration system.
Edit: Oh obviously It's a MySQL one if you didn't figure that out
Now I'm adding money and Skin information.. Basically.. My problem with money is, it doesn't read what i really have.. Ie: I had $500, while i was testing skin codes it came up as $-1....
Anyway.. Right now what's important is how do i load the skin upon connection(Or, in my case, it's in "OnPlayerRequestClass"...
Here's my code.. Tell me anything you know, Optimization, Stupidness, etc ..(This is just my OnPlayerRequestClass...)
The Bold is what i've been toying with.. What happens is.. It returns 1(True) instead of What's in the column.. How do i do this is what my problem is.. As i'm new to this shit.. And don't tell me i shouldn't be doing this if I'm new.. I'm doing this to learn as I go..
Also the Red is what i've added just to see if it does anything


Quote:

public OnPlayerRequestClass(playerid, classid)
{
new
query[300],
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(query,sizeof(query),"SELECT Skin FROM `users` WHERE Username = '%s' LIMIT 1",pName);
mysql_query(query);
skinid[playerid] = mysql_fetch_int();

SetSpawnInfo(playerid, NO_TEAM, SetPlayerSkin(playerid,skinid[playerid]), 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
return 0;
}

Edit:
Is it possible to remove class's and teams and all that shit and still work? Like.. I've seen in RP Servers where they remove this and run it another way. But the ones i see use "Teams" and I don't wanna deal with that shit..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)