Checkpoint dissappears
#1

Hello.

How I can do that the checkpoint would not dissappear when I do something in else statement? I want to print the message to remind player something and get back later but the checkpoint dissappears.

Код:
hook OnPlayerEnterDynamicCP(playerid, checkpointid)
{
	if(checkpointid == pizzaCheckpoint[playerid])
	{
        if(IsPlayerAttachedObjectSlotUsed(playerid, PIZZA_INDEX))
        {
            new string[126], earning = 5 + random(5);
            pizzaEarnings[playerid] += earning;
            		
            if(pizzaDeliveryTimeLeft[playerid] > 0)
            {
                pizzaDeliveryTimeLeft[playerid] = 0;
                KillTimer(pizzaDeliveryTimer[playerid]);
                
                new tips = 1 + random(MAX_TIP);
                pizzaTips[playerid] += tips;
    			
    		PlayerTextDrawHide(playerid, pizzaTextDraw5[playerid]);
            	PlayerTextDrawHide(playerid, pizzaTextDraw7[playerid]);
            	PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
	    }
			
	    ClearAnimations(playerid);
	    DestroyDynamicCP(pizzaCheckpoint[playerid]);
        }
        else
        {
	// else statement
	}
        }
	return 1;
}
Reply
#2

I don't understand very well what you wan't to do can you explain better?
Reply
#3

Quote:
Originally Posted by Micko123
Посмотреть сообщение
I don't understand very well what you wan't to do can you explain better?
I don't want my checkpoint to dissappear after I enter it. It's okay if it dissappears in the if statement, but I don't want it to dissappear when the else is called so I could write a message for a player while stile having the checkpoint at it's place.
Reply
#4

Anyone knows?
Reply
#5

PHP код:
hook OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == pizzaCheckpoint[playerid])
    {
        if(
IsPlayerAttachedObjectSlotUsed(playeridPIZZA_INDEX))
        {
            new 
string[126], earning random(5);
            
pizzaEarnings[playerid] += earning;
                    
            if(
pizzaDeliveryTimeLeft[playerid] > 0)
            {
                
pizzaDeliveryTimeLeft[playerid] = 0;
                
KillTimer(pizzaDeliveryTimer[playerid]);
                new 
tips random(MAX_TIP);
                
pizzaTips[playerid] += tips;
                
PlayerTextDrawHide(playeridpizzaTextDraw5[playerid]);
                
PlayerTextDrawHide(playeridpizzaTextDraw7[playerid]);
                
PlayerPlaySound(playerid11390.00.00.0);
           }    
           
ClearAnimations(playerid);
           
DestroyDynamicCP(pizzaCheckpoint[playerid]);
        }
        else
        {
           
SendClientMessage(playerid, -1"Here goes your message");
           return 
1;
        }
    }
    return 
1;

Reply
#6

Quote:
Originally Posted by Micko123
Посмотреть сообщение
PHP код:
hook OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == pizzaCheckpoint[playerid])
    {
        if(
IsPlayerAttachedObjectSlotUsed(playeridPIZZA_INDEX))
        {
            new 
string[126], earning random(5);
            
pizzaEarnings[playerid] += earning;
                    
            if(
pizzaDeliveryTimeLeft[playerid] > 0)
            {
                
pizzaDeliveryTimeLeft[playerid] = 0;
                
KillTimer(pizzaDeliveryTimer[playerid]);
                new 
tips random(MAX_TIP);
                
pizzaTips[playerid] += tips;
                
PlayerTextDrawHide(playeridpizzaTextDraw5[playerid]);
                
PlayerTextDrawHide(playeridpizzaTextDraw7[playerid]);
                
PlayerPlaySound(playerid11390.00.00.0);
           }    
           
ClearAnimations(playerid);
           
DestroyDynamicCP(pizzaCheckpoint[playerid]);
        }
        else
        {
           
SendClientMessage(playerid, -1"Here goes your message");
           return 
1;
        }
    }
    return 
1;

The checkpoint still dissappears when I enter it and the text is showed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)