Keeps showing in Login screen
#1

'This text "+ 5 Health supplie from the snake farms captured by your team and the other one" keeps showing in login screen. every 2-3 seconds.

How do I remove it from login screen? and when I spawned it's not showing again.


Код:
forward ZoneBonouses();
public ZoneBonouses()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
    	if(tCP[SNAKE] == Team[i])
    	{
			SendClientMessage(i, -1, ""COL_GREEN">> "COL_WHITE"+ 5 Health supplie from the snake farms captured by your team.");
			new Float:hp;
			GetPlayerHealth(i, hp);
			SetPlayerHealth(i, hp+5);
		}
		if(tCP[ARMY] == Team[i])
    	{
			SendClientMessage(i, -1, ""COL_GREEN">> "COL_WHITE"+ 10 Ammu for your current weapon supplie from the snake farms captured by your team.");
			switch(GetPlayerWeapon(i))
			{
			    case 16, 17, 18, 35, 36, 37, 38, 39, 42: return false;
			}
			GivePlayerWeapon(i, GetPlayerWeapon(i), 10);
		}
	}
	return 1;
}
Reply
#2

because you added

pawn Код:
SendClientMessage(i, -1, ""COL_GREEN">> "COL_WHITE"+ 5 Health supplie from the snake farms captured by your team.");
in timer so if timer running and set on seconds so its showing at 2 or 3 seconds
Reply
#3

under ongamemodeinit I saw this.
Quote:

SetTimer("ZoneBonouses", 30000, true);

where should I place this then?

If will remove
Quote:

"SetTimer("ZoneBonouses", 30000, true);"

then when I captured a base it will not show.
Reply
#4

SetTimer("ZoneBonouses", 30000, true);

it means keep timer run and time is 30 seconds

EDIT:

try
pawn Код:
SetTimerEx("ZoneBonouses", 30000, false, "i", playerid);
Reply
#5

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
SetTimer("ZoneBonouses", 30000, true);

it means keep timer run and time is 30 seconds

EDIT:

try
pawn Код:
SetTimerEx("ZoneBonouses", 30000, false, "i", playerid);
hi. it shows "undefined symbol playerid" after compiling.
Reply
#6

then remove this timer and put your old one and just change true to false then check


pawn Код:
SetTimer("ZoneBonouses", 30000, true);

to

pawn Код:
SetTimer("ZoneBonouses", 30000, false);
Reply
#7

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
then remove this timer and put your old one and just change true to false then check


pawn Код:
SetTimer("ZoneBonouses", 30000, true);

to

pawn Код:
SetTimer("ZoneBonouses", 30000, false);
So it will stop the timer even I captured the snake farms and there will no bonus?
Reply
#8

LOL man. After I captured the snake farm. the +10 ammu for your current weapon didn't show anymore, but the +5 health supplie shows.


a little bit fail

EDIT: Nvm i'm just going to remove the bonus
Reply
#9

Using return will stop the loop and the second message will not be sent.

The timer will be called every 30 seconds and the messages will be sent. If you want to prevent from being displayed when you're spawned, the use a variable to check it.
pawn Код:
// global:
new bool: Player_Spawned[MAX_PLAYERS char];

// OnPlayerConnect:
Player_Spawned{playerid} = false;

// OnPlayerSpawn:
Player_Spawned{playerid} = true;

// OnPlayerDeath:
Player_Spawned{playerid} = false;
and in the loop:
pawn Код:
if (Player_Spawned{i}) continue; // If the player is spawned, skip and don't send the message
You may need to check if the player is not in spectating mode.
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Using return will stop the loop and the second message will not be sent.

The timer will be called every 30 seconds and the messages will be sent. If you want to prevent from being displayed when you're spawned, the use a variable to check it.
pawn Код:
// global:
new bool: Player_Spawned[MAX_PLAYERS char];

// OnPlayerConnect:
Player_Spawned{playerid} = false;

// OnPlayerSpawn:
Player_Spawned{playerid} = true;

// OnPlayerDeath:
Player_Spawned{playerid} = false;
and in the loop:
pawn Код:
if (Player_Spawned{i}) continue; // If the player is spawned, skip and don't send the message
You may need to check if the player is not in spectating mode.
what you mean in the loop? where?
Код:
forward ZoneBonouses();
public ZoneBonouses()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
    	if(tCP[SNAKE] == Team[i])
    	{
			SendClientMessage(i, -1, ""COL_GREEN">> "COL_WHITE"+ 5 Health supplie from the snake farms captured by your team.");
			new Float:hp;
			GetPlayerHealth(i, hp);
			SetPlayerHealth(i, hp+5);
		}
		if(tCP[ARMY] == Team[i])
    	{
			SendClientMessage(i, -1, ""COL_GREEN">> "COL_WHITE"+ 10 Ammu for your current weapon supplie from the snake farms captured by your team.");
			switch(GetPlayerWeapon(i))
			{
			    case 16, 17, 18, 35, 36, 37, 38, 39, 42: return false;
			}
			GivePlayerWeapon(i, GetPlayerWeapon(i), 10);
		}
	}
	return 1;
}
Basically the code above is a capture bonus. If a player captured the snake base and the army base they will receive +10 ammu or +5 (depends on which base they'd captured) then every 30 seconds they will receive the bonus. if a different team captured the snake or army base then timer will stop and they will not receive bonus.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)