Event system bug
#1

I have when 2 players join the event the time remaining show in double how to fix?

PHP код:
forward textdraw2();
public 
textdraw2()
{
    
// You decrease the start time here
    
EventFinishTime--;
     
// Check if we need to start the event
    
if(EventFinishTime == 0)
    {
        
/*StartYourEvent;*/
        
KillTimer(EventFinishTimer);
        
EventFinishTime 50;
        
EventCountDown false;
        
eventstarted false;
        
eventready false;
        
SendClientMessageToAll(0xFFF000FF,"* The Event Has Been Finished");
        
event_type Non;
        
EventFinishTime 200;
        
totalp_event=0;
        foreach(
Player,i)
        {
        if(
InEvents[i][InEvent] == 1)
        {
        
SpawnPlayer(i);
        
InEvents[i][InEvent] = 0;
        
TextDrawHideForPlayer(i,TDEditor_TD[2]);
        
TextDrawShowForPlayer(i,randommsg);
        }
        }
    }
        else
    {
         new 
string[1243];
        foreach(
Player,i)
        {
        if(
InEvents[i][InEvent] == 1)
        {
        
format(stringsizeof(string), "____________________________________________Time_Remaining_%d_seconds"EventFinishTime);
        
TextDrawSetString(TDEditor_TD[2], string);
        
TextDrawShowForAll(TDEditor_TD[2]);
        }
        }
        }

Reply
#2

Any help
Reply
#3

Quote:
Originally Posted by Loinal
Посмотреть сообщение
Any help
You have done pretty silly mistakes.
PHP код:
forward textdraw2(); 
public 
textdraw2() 

    
// You decrease the start time here 
    
EventFinishTime -=1
     
// Check if we need to start the event 
    
if(EventFinishTime <= 0
    { 
        
/*StartYourEvent;*/ 
        
KillTimer(EventFinishTimer); // you are killing the event timer
        
EventFinishTime 50// setting the event finish time to 50
        
EventCountDown eventstarted eventready false// sets everything to false
        
SendClientMessageToAll(0xFFF000FF,"* The Event Has Been Finished");  // sends msg
        
event_type Non// finishes event
        
EventFinishTime 200// increases the event time to 200, why set 50 and then 200? /*ANSWER*/
        
totalp_event=0//sets another var's value to 0
        
foreach(new Player//loop 
        

            if(
InEvents[i][InEvent] == 1//checks for event players
            

                
SpawnPlayer(i); //spawn playrers
                
InEvents[i][InEvent] = 0//event var 0
                
TextDrawHideForPlayer(i,TDEditor_TD[2]); //hides td
                
TextDrawShowForPlayer(i,randommsg);  //shows td
            

        } 
    } 
    else 
    {
        new 
string[1243]; // why the placeholder has this much value? lol?
        
foreach(new Player
        { 
            if(
InEvents[i][InEvent] == 1
            { 
                
format(stringsizeof(string),"____________________________________________Time_Remaining_%d_seconds"EventFinishTime);
                
TextDrawSetString(TDEditor_TD[2], string); 
                
TextDrawShowForAll(TDEditor_TD[2]); // lol lol lol --> change this into TextDrawShowForPlayer(i, TDEditor_TF[2]);
            

        }
    } 

Reply
#4

not working
Reply
#5

Have you read the comments in the code? Try replying to my questions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)