Timer help!
#1

So I want to add a timer so the players color will go back to invisible

Код HTML:
task randomcolor[45 * 1000]()
{
	new playerid = Iter_Random(Player);
	if(Dead[playerid] == false)
	{
		SetPlayerColor(playerid, 0xFF0000);
		GameTextForPlayer(playerid, "~r~Red dot~w~!", 5000, 3);
		GameTextForAll("~r~Check the map~w~!", 5000, 3);
              // I WANT A 15 SECOND TIMER HERE //
               SetPlayerColor(playerid, 0xFF0000);
	}

	return 1;
Reply
#2

read

https://sampwiki.blast.hk/wiki/SetTimerEx
and use https://sampwiki.blast.hk/wiki/SetPlayerColor to make player go back invisible
Reply
#3

I've tried, it's confusing.
Reply
#4

Or use a tick timer that resets their color after counting down in their variables.
Reply
#5

Any ideas? I can't seem to do it
Reply
#6

sorry off topic


how to add this code
COMMAND:agiveweapon(playerid, params[])
{
if(!logged[playerid])
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in!");

if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use that command!");

new
targetid = INVALID_PLAYER_ID,
weaponid,
ammo;

if(sscanf(params, "uii", targetid, weaponid ammo))
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");

if(!IsPlayerConnected(targetid))
{
format(string, sizeof(string), "ID:%d is not an active player.", targetid);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
return 1;
}

new
targetName[MAX_PLAYER_NAME],
weaponName[32];

GetPlayerName(targetid, targetName, sizeof targetName);
GetWeaponName(weaponid, weaponName, sizeof weaponName);

GivePlayerWeapon(targetid, weaponid, ammo);

format(string, sizeof(string), "You have given %s a %d with %d ammo.", targetName, weaponName, ammo);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}

i compile it and i get error like this

C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : error 017: undefined symbol "logged"
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : warning 215: expression has no effect
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : error 001: expected token: ";", but found "]"
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : error 029: invalid expression, assumed zero
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

or how to short this code to zcmd code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)