SA-MP Forums Archive
Change color each second - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Change color each second (/showthread.php?tid=82496)



Change color each second - honzk - 18.06.2009

Hi all, could some1 help me with this: I want to change color of player which has string Bounty == 1 each second. From black to white, after 1 sec from white to black etc...

Thx


Re: Change color each second - MenaceX^ - 18.06.2009

For a specific player? Or for everybody?


Re: Change color each second - honzk - 18.06.2009

For player which has value of string Bounty 1...
But it can be more players than 1


Re: Change color each second - The_Tough - 18.06.2009

I found this,its for a player and its an admin command you can take a look and create your own system

Код:
dcmd_highlight(playerid,params[]) {
  if(PlayerInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid)) {
	  if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /highlight [playerid]");
	  new player1, playername[MAX_PLAYER_NAME], string[128];
	  player1 = strval(params);

	 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
		 	GetPlayerName(player1, playername, sizeof(playername));
	 	  if(PlayerInfo[player1][blip] == 0) {
				CMDMessageToAdmins(playerid,"HIGHLIGHT");
				PlayerInfo[player1][pColour] = GetPlayerColor(player1);
				PlayerInfo[player1][blip] = 1;
				BlipTimer[player1] = SetTimerEx("HighLight", 1000, 1, "i", player1);
				format(string,sizeof(string),"You have highlighted %s's marker", playername);
			} else {
				KillTimer( BlipTimer[player1] );
				PlayerInfo[player1][blip] = 0;
				SetPlayerColor(player1, PlayerInfo[player1][pColour] );
				format(string,sizeof(string),"You have stopped highlighting %s's marker", playername);



Re: Change color each second - honzk - 18.06.2009

I have this:

Quote:

dcmd_bounty(playerid, params[])
{
new tmp[256], idx, pid, pmoney;
tmp = strtok(params, idx);
if(!strlen(tmp))
{
Usage(playerid, "Usage: /bounty [id]");
return 1;
}
pid = strval(tmp);
if(pid == playerid)
{
Error(playerid, "You can't set bounty on yourself!");
return 1;
}
if(!IsPlayerConnected(pid))
{
Error(playerid, "Error: Incorrect playerid!");
return 1;
}
pmoney = GetPlayerMoney(playerid);
if(pmoney <= 4999)
{
Error(playerid, "Error: You don't have enough money!");
return 1;
}
GivePlayerMoney(playerid, -5000);
Bounty[pid] = 1;
SetPlayerColor(pid, COLOR_WHITE);
SetPlayerArmour(pid, 100);
SetPlayerHealth(pid, 100);
GivePlayerWeapon(pid, 38, 200);
bigdollar = CreateObject(1274, 0, 0, 0, 0, 0, 0);
AttachObjectToPlayer(bigdollar, pid, 0, 0, 2, 0, 0, 0);
return 1;
}

But instead of "SetPlayerColor(pid, COLOR_WHITE);" I want to put there a timer which changes your color each sec...


Re: Change color each second - mamorunl - 18.06.2009

so.. what's the problem? just add a Timer which randomly changes the color : >


Re: Change color each second - honzk - 19.06.2009

You are right, I want to help with timer, because I can't use timers...