SA-MP Forums Archive
SetPlayerColor - Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetPlayerColor - Problem (/showthread.php?tid=572640)



SetPlayerColor - Problem - Vaki - 30.04.2015

Color appears for a few seconds, but then disappears . Please help .. I bold SetPlayerColor in code..

Код:
YCMD:duznost(playerid, params[], help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return Ulogovan(playerid);
	new string[256];
	if(PlayerInfo[playerid][pClan] != 1 && PlayerInfo[playerid][pLider] != 1) return SCM(playerid,-1,""PLAVA"[GRESKA] "SIVA"Samo clanovi BSPD!");
	if(!IsPlayerInRangeOfPoint(playerid, 4.0,1456.8413,-1761.3394,3285.2859)) return SCM(playerid,-1,""PLAVA"(GRESKA) "SIVA"Niste u prostoriji za uzimanje duznosti!");
	if(PolicajacNaDuznosti[playerid] == 0)
	{
		if(PlayerInfo[playerid][pClan] == 1 || PlayerInfo[playerid][pLider] == 1)
		{
			format(string, sizeof(string), "* Policajac %s uzima znacku i pistolj iz ormarica.", GetName(playerid));
		}
		ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
		SCM(playerid,-1,""PLAVA"[BSPD] "BELA"Sada ste na duznosti!");
		g_GivePlayerWeapon(playerid,24,150);
 		g_GivePlayerWeapon(playerid, 3, 0);
		SetPlayerArmour(playerid, 99.0);
		g_SetPlayerHealth(playerid, 99.0);
        SetPlayerColor(playerid,0x3A5FCD00);
		PolicajacNaDuznosti[playerid] = 1;
	}
	else if(PolicajacNaDuznosti[playerid] == 1)
	{
		if(PlayerInfo[playerid][pClan] == 1 || PlayerInfo[playerid][pLider] == 1)
		{
			format(string, sizeof(string), "* Policajac %s stavlja pistolj i znacku u svoj ormaric.", GetName(playerid));
		}
		ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
		SCM(playerid,-1,""PLAVA"[BSPD] "BELA"Vise niste na duznosti!");
		ResetPlayerWeapons(playerid);
		SetPlayerArmour(playerid, 0);
		g_SetPlayerHealth(playerid, 99.0);
		BelaBojaIgraca(playerid);
		PolicajacNaDuznosti[playerid] = 0;
	}
	return 1;
}



Re: SetPlayerColor - Problem - Abagail - 30.04.2015

Maybe you reset it somewhere such as OnPlayerUpdate? Check if it's anywhere else within your script.


Re: SetPlayerColor - Problem - Vaki - 30.04.2015

I add OnPlayerUpdate :
Код:
if(PolicajacNaDuznosti[playerid] == 1)
{
	SetPlayerColor(playerid,0x3A5FCD00);
	return 1;
}