[HELP] Faction Colors Problem
#1

Hey guys,

I'm developing a server and I started with "Raven's Roleplay" and started editing it. Now I have been trying to put colored names for faction members. Example, if the person is from the faction Tattaglia, his name color to be Yellow. The problem is that when I put it into the script, everything seems to work, no errors at all, but only the FIRST person who join the server receives the name color, I mean, only the player with the ID "0" gets the color for his faction and the others dont. The colors and information are all defined, the problem is how to make each players receive its color at the same time. How can I fix this?

Here is the code I'm using:
Код:
public FactionColor(playerid)
{
	if(gPlayerLogged[playerid] == 1)
	{
		if(PlayerInfo[playerid][pLeader] == 6)//------------Scarpetta Leader------------------
		{
			SetPlayerColor(playerid,0x800000FF);
			return 1;
		}
			
		else if(PlayerInfo[playerid][pLeader] == 14)//------Giordano Leader-------------------
		{
			SetPlayerColor(playerid,0x800000FF);
			return 1;
		}
		
		else if(PlayerInfo[playerid][pMember] == 6)//-------Scarpetta-------------------------
		{
			SetPlayerColor(playerid,0xEAEA00FF);
			return 1;
		}
		
		else if(PlayerInfo[playerid][pMember] == 14)//------Giordano--------------------------
		{
			SetPlayerColor(playerid,0xFF0000FF);
			return 1;
		}
		
		else //---------------------------------------------Civilian--------------------------
		{
			SetPlayerColor(playerid,0xFFFFFFFF);
			return 1;
		}
		return 0;
	}
	return 0;
}
And when the player spawn I putted this code
Код:
SpawnPlayer(playerid);
SetTimer("FactionColor", 1000, 0);
Obs: The function to spawn is nto only SpawnPlayer.
Reply
#2

I honestly don't know why new scripters are always so attracted to the most complicated (and most inefficient) scripts that have been made. Is it so hard to start with something simple?

Anyway, you'd want to use SetTimerEx to solve your problem.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
I honestly don't know why new scripters are always so attracted to the most complicated (and most inefficient) scripts that have been made. Is it so hard to start with something simple?

Anyway, you'd want to use SetTimerEx to solve your problem.
Hello, I am trying that right now. I have received an error saying that the Number of arguments does not match definition. After research I found that the SetTimerEx had different Definition and I dont know what to put on the last two arguments, what should I put to make it go to that function?
Reply
#4

Nevermind, I fixed it. Thank you Vince.

The problem was really at SetTimer and I fixed it replacing for:
Код:
SetTimerEx("FactionColor",1000,false,"i",playerid);
Thank you,
Avsecret
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)