28.05.2010, 15:08
Hey guys
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
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
Код:
#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;
}


