help with setplayercolor();
#1

here is my code to set the org colour:

Код:
CMD:ocolour(playerid, params[])
{
	new id,colour[64], query[128];
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "You cannot use this command.");
 	if(sscanf(params,"is",id,colour)) return SendClientMessage(playerid, red, "USAGE:/ocolour [id] [colour]");
 	format(query, sizeof(query), "UPDATE orgs SET Colour='%s' WHERE ID=%d",colour,id);
 	mysql_query(query);
 	return 1;
}
to set colour:

Код:
CMD:oskin(playerid, params[])
{
	SetPlayerColor(playerid, ocolour[playerid]);
	SetPlayerSkin(playerid, oskin[playerid] & oskin1[playerid] & oskin2[playerid]);
	return 1;
}
loading part:

Код:
LoadOstats(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	new query[128];
	format(query, sizeof(query), "SELECT * FROM ostats WHERE name='%s'", name);
	mysql_query(query);
	mysql_store_result();
	
	new row[128];
	new field[13][32];

	mysql_fetch_row_format(row, "|");
	explode(row, field, "|");

	org[playerid] =strval(field[1]);
	leader[playerid]=strval(field[3]);
	req[playerid]=strval(field[2]);
	
	mysql_free_result();
	
	new string[128];
	format(string, sizeof(string), "SELECT * FROM orgs WHERE ID=%d", org[playerid]);
	mysql_query(string);
	mysql_store_result();
	mysql_fetch_row_format(row, "|");
	explode(row, field, "|");
	format(oname[playerid], 32, "%s", field[1]);
	format(ocolour[playerid], 32, "%s", field[2]);
	otype[playerid]=strval(field[3]);
	oskin[playerid]=strval(field[4]);
	oskin1[playerid]=strval(field[5]);
	oskin2[playerid]=strval(field[6]);
	mysql_free_result();
	return 1;
}
the thing is the hex code gets stored in my sql and it loads with 0xcode but when i use setplayercolor it sets the colour to black. help please
Reply


Messages In This Thread
help with setplayercolor(); - by THE_KNOWN - 05.02.2011, 12:56
Re: help with setplayercolor(); - by Vince - 05.02.2011, 13:36
Re: help with setplayercolor(); - by THE_KNOWN - 05.02.2011, 13:37
Re: help with setplayercolor(); - by THE_KNOWN - 05.02.2011, 14:05
Re: help with setplayercolor(); - by Zack9764 - 05.02.2011, 14:21
Re: help with setplayercolor(); - by MadeMan - 05.02.2011, 14:23

Forum Jump:


Users browsing this thread: 2 Guest(s)