SA-MP Forums Archive
Event System - 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: Event System (/showthread.php?tid=509517)



Event System - chubz - 27.04.2014

Hey Guys

Im trying to make an event and if in that event if there is only one person the event stops and returns everyone back but if there is more than 1 person it keeps on going but its not working even if there are 2 and more people it keeps cancelling the event can you help!! Thanx

Код:
if(PlayerInfo[i][DMEvent] == 1)
{        
        new Float:player_health;
        GetPlayerHealth(i, player_health);
	if(player_health > 0 || GetPlayerState(i) != PLAYER_STATE_WASTED || PlayerInfo[i][DMEvent] == 1)
	{
		Players++;
	}
	if(Players <= 1)
	{
              SendClientMessageToAll(-1, "DM Event Has Cancelled, Type \"/DMEvent\" to create new Match!!");
	      PlayerTextDrawHide(i,TextdrawB2[i]);
	      DMEventTime[i] = 10 ;
	      KillTimer(timer1);
	      Players = 0;
	      ResetPlayerWeapons(i);
	      PlayerInfo[i][DMEvent] = 0;
	      LoadStats(i);
	 }
}



Re: Event System - chubz - 27.04.2014

Cant Anyone Help Me Please!!!


Re: Event System - spykidz01 - 27.04.2014

try this

Код:
if(PlayerInfo[i][DMEvent] <= 1)
{        
        new Float:player_health;
        GetPlayerHealth(i, player_health);
	if(player_health > 0 || GetPlayerState(i) != PLAYER_STATE_WASTED || PlayerInfo[i][DMEvent] == 1)
	{
		Players++;
	}
	if(Players == 1)
	{
              SendClientMessageToAll(-1, "DM Event Has Cancelled, Type \"/DMEvent\" to create new Match!!");
	      PlayerTextDrawHide(i,TextdrawB2[i]);
	      DMEventTime[i] = 10 ;
	      KillTimer(timer1);
	      Players = 0;
	      ResetPlayerWeapons(i);
	      PlayerInfo[i][DMEvent] = 0;
	      LoadStats(i);
	 }



Re: Event System - BroZeus - 27.04.2014

pawn Код:
if(Players <= 1)
    {
              SendClientMessageToAll(-1, "DM Event Has Cancelled, Type \"/DMEvent\" to create new Match!!");
          PlayerTextDrawHide(i,TextdrawB2[i]);
          DMEventTime[i] = 10 ;
          KillTimer(timer1);
          Players = 0;
          ResetPlayerWeapons(i);
          PlayerInfo[i][DMEvent] = 0;
          LoadStats(i);
     }
the above statements should be out of the loop which u are using


Re: Event System - chubz - 27.04.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
pawn Код:
if(Players <= 1)
    {
              SendClientMessageToAll(-1, "DM Event Has Cancelled, Type \"/DMEvent\" to create new Match!!");
          PlayerTextDrawHide(i,TextdrawB2[i]);
          DMEventTime[i] = 10 ;
          KillTimer(timer1);
          Players = 0;
          ResetPlayerWeapons(i);
          PlayerInfo[i][DMEvent] = 0;
          LoadStats(i);
     }
the above statements should be out of the loop which u are using
What do you Mean?


Re: Event System - chubz - 27.04.2014

Im Really Confused!!


Re: Event System - chubz - 27.04.2014

Does Anyone have any ideas on how i can check if the players in that event are less than two people that it will cancel the event else the event keeps on going.

PLEASE!!


Re: Event System - Ahmad45123 - 27.04.2014

Try this :
pawn Код:
if(PlayerInfo[i][DMEvent] <= 1)
{        
        new Float:player_health;
        GetPlayerHealth(i, player_health);
    if(player_health > 0 || GetPlayerState(i) != PLAYER_STATE_WASTED || PlayerInfo[i][DMEvent] == 1)
    {
        Players++;
    }
    if(Players == 1)
    {
              SendClientMessageToAll(-1, "DM Event Has Cancelled, Type \"/DMEvent\" to create new Match!!");
          PlayerTextDrawHide(i,TextdrawB2[i]);
          DMEventTime[i] = 10 ;
          KillTimer(timer1);
          Players = 0;
          ResetPlayerWeapons(i);
          PlayerInfo[i][DMEvent] = 0;
          LoadStats(i);
     }