Change color each second
#1

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
Reply
#2

For a specific player? Or for everybody?
Reply
#3

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

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);
Reply
#5

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...
Reply
#6

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

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


Forum Jump:


Users browsing this thread: