SA-MP Forums Archive
Pickup problems - 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: Pickup problems (/showthread.php?tid=464893)



Pickup problems - CesarLT - 19.09.2013

Hello guys, I've a simple question, how for gods sake can I make a pickup stop looping, I mean I am using pickup which leads to a dialog, and even tho' I close the dialog, it repeats itself after 1 millisecond and basically blocks the movement lol, is it something with the pickup type, or some loop problem? Anyways, thanks ahead for the answer.


Re: Pickup problems - Dana_scully - 19.09.2013

TogglePlayerControllable(playerid, 1);


Re: Pickup problems - =KempeR= - 19.09.2013

Give us a code!


Re: Pickup problems - CesarLT - 19.09.2013

Quote:
Originally Posted by Dana_scully
Посмотреть сообщение
TogglePlayerControllable(playerid, 1);
I do not understand, will that stop the pickup from looping over itself? Since it just freezes my cahracter, doesn't make the pickup stable.

Quote:
Originally Posted by =KempeR=
Посмотреть сообщение
Give us a code!
What for? I am just asking if there's a way to stop it.
P.S. - It's a pickup which leads to a dialog which leads to ondialogresponse, a simple weapon menu, nothing special.


Re: Pickup problems - Lidor124 - 19.09.2013

I not think its possible to stop the pickups keep looping because its a source of san andreas...


Re: Pickup problems - Konstantinos - 19.09.2013

pawn Код:
// global
new
    bool: In_Pickup[ MAX_PLAYERS ]
;

// OnPlayerConnect
In_Pickup[ playerid ] = false;

// Where you want it to stop showing all the time.
if( IsPlayerInRangeOfPoint( playerid, 1.0, X, Y, Z ) ) // CHANGE THE COORDINATES
{
    if( !In_Pickup[ playerid ] )
    {
        In_Pickup[ playerid ] = true;
        ShowPlayerDialog( ... );
    }
}
else
{
    if( In_Pickup[ playerid ] ) In_Pickup[ playerid ] = false;
}



Re: Pickup problems - Vanter - 19.09.2013

What I use is, VARIABLES! PROBABLY EASIEST THING IN PAWNO!

pawn Код:
new Used1[MAX_PLAYERS];

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    //==============================Banks=====================================//
    if(pickupid == BankEnt1)
       {  
           if(Used1[playerid] == 0)
          {
               SHOW DIALOG
               Used1[playerid] =1;
          }
       return 1;
    }
}

//The on player close dialog, make a timer so it sets Used1 to zero.
That's a simple solution


Re: Pickup problems - CesarLT - 20.09.2013

Quote:
Originally Posted by Vanter
Посмотреть сообщение
What I use is, VARIABLES! PROBABLY EASIEST THING IN PAWNO!

pawn Код:
new Used1[MAX_PLAYERS];

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    //==============================Banks=====================================//
    if(pickupid == BankEnt1)
       {  
           if(Used1[playerid] == 0)
          {
               SHOW DIALOG
               Used1[playerid] =1;
          }
       return 1;
    }
}

//The on player close dialog, make a timer so it sets Used1 to zero.
That's a simple solution
I've did it, but I didn't get the timer stuff, I mean it works fine and no loops or shit like that, but once I enter a pickup, it stops working after that..


Re: Pickup problems - iJumbo - 20.09.2013

Use the Konstantinos one


Re: Pickup problems - Vanter - 20.09.2013

because you didn't make atimer
here it is
pawn Код:
SetPVarInt(playerid, "DoorTimer", SetTimerEx("DOOR", 5000, 1, "i", playerid)); //5seconds timer

forward DOOR(playerid);
public DOOR(playerid)
{
    Used1[playerid] =0;
}