litle problem.
#1

hey guys. I'm having a little problem at the moment.
I'm working with teams now. But something is really strange.
I hope you guys will understand this.

When you spawn you will have your name colored to the team color. That is waht must happen.
This is also saving. SO when I relog I will have the color again. But when I have a red color and I relog and I join as ID 0 I see the exact color name as I had when I logged off. That was just good,
Then I logged in as ID 1 and I did see my name in a purple color. But the other people saw my name color as the color I logged of with.

So the problem is:
You only see your color from where you logged in as ID 0.
Other people see the good color. But when you are not ID 0 you will see your own color wrong.
Please help me guys.

I'm using this at where the player stats saves:
dUserSetINT(PlayerName2(playerid)).("Color",GetPla yerColor(playerid));

and this is when theb player logs in.
the whole script of the login
Код:
LoginPlayer(playerid)
{
	if(ServerInfo[GiveMoney] == 1) {ResetPlayerMoney(playerid); GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money") ); }

	dUserSetINT(PlayerName2(playerid)).("loggedin",1);
	SetPlayerColor(playerid, dUserINT(PlayerName2(playerid)).("Color") );
	PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
	PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
	PlayerInfo[playerid][Exp] = (dUserINT(PlayerName2(playerid)).("Exp"));
	PlayerInfo[playerid][Bank] = (dUserINT(PlayerName2(playerid)).("Bank"));
 	PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
  	PlayerInfo[playerid][hours] = dUserINT(PlayerName2(playerid)).("hours");
  	PlayerInfo[playerid][mins] = dUserINT(PlayerName2(playerid)).("minutes");
  	PlayerInfo[playerid][secs] = dUserINT(PlayerName2(playerid)).("seconds");
	PlayerInfo[playerid][Registered] = 1;
 	PlayerInfo[playerid][LoggedIn] = 1;
}
You can see the setcolor
Reply
#2

can anyone help me or need more explanatioN?
Reply
#3

lawl. Waited the whole night
Reply
#4

... I know I have to wait 12 hours. But I just need this. Is there some more information needed or better explaineD?
Reply
#5

I need the SetPlayerToTeamColor code to help
Reply
#6

Well. The problem now is:
Everyone sees YOUR color correctly except yourself.
You see yourself as a weird color. Not the color you logged of with.
This is the script now
Код:
#include <a_samp>
#include <Dini>
#define ColorFile 	    		"Colors/%s.ini"
public OnFilterScriptInit()
{
SetTimer("CallConnect",1,0);
return 1;
}
forward CallConnect(playerid);
public CallConnect(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
OnPlayerConnect(i);
}
return 1;
}
public OnPlayerConnect(playerid)
{
 	new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),ColorFile,Name);
	if(!dini_Exists(file)) {
		dini_Create(file);
		dini_IntSet(file,"Color",GetPlayerColor(playerid));
	}
	else if(dini_Exists(file))
	{
	SetPlayerColor(playerid,dini_Int(file,"Color"));
	}
	return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
 	new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),ColorFile,Name);
	dini_IntSet(file,"Color",GetPlayerColor(playerid));
	return 1;
}
Reply
#7

Some better explain here:

The color is saving but this is wrong:
my color is saved as blue.
[IMG=/imageshack/img411/1713/samp028y.png][/IMG]

Uploaded with ImageShack.us

I'm uchiha and my friend is jorambo on that picture.
Well. I see my name as purple. That suposed to be blue.
Jorambo sees that it is blue. But my problem is that when you don't have ID 0 you see your color as anohter color that you logged of with.
only ID 0 can see his own name correctly. But you do can see other people their names correctly.
please help

Code
Код:
#include <a_samp>
#include <Dini>
#define ColorFile 	    		"Colors/%s.ini"
public OnFilterScriptInit()
{
SetTimer("CallConnect",1,0);
return 1;
}
forward CallConnect(playerid);
public CallConnect(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
OnPlayerConnect(i);
}
return 1;
}
public OnPlayerConnect(playerid)
{
 	new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),ColorFile,Name);
	if(!dini_Exists(file)) {
		dini_Create(file);
		dini_IntSet(file,"Color",GetPlayerColor(playerid));
	}
	else if(dini_Exists(file))
	{
	SetPlayerColor(playerid,dini_Int(file,"Color"));
	}
	return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
 	new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),ColorFile,Name);
	dini_IntSet(file,"Color",GetPlayerColor(playerid));
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)