Something that confused me - 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: Something that confused me (
/showthread.php?tid=278460)
Re: Something that confused me -
Adil - 22.08.2011
pawn Code:
if(pickupid == iSherrifsLockers)
{
if(JustPicked[playerid] == 0)
{
if(IsASherrif(playerid))
{
ShowPlayerDialog(playerid, DIALOG_SHERRIFLOCKERS, DIALOG_STYLE_LIST, "Sherrifs Lockers","Sherrif Duty\nWeaponary\nChange Uniform","Select","Cancel");
}
else
{
SendClientMessage(playerid, COLOUR_YELLOW, "* You are not a GroomLake Sherrif!");
return 1;
}
JustPicked[playerid] = 1;
SetTimerEx("Pickable", 5000, 1, "d", playerid);
}
return 1;
}
/////////////////////////////////////
public Pickable(playerid)
{
if(!IsPlayerInRangeOfPoint(playerid, 3, pickupx, pickupy, pickupz))
{
JustPicked[playerid] = 0;
KillTimer(Pickable);
}
return 1;
}
Re: Something that confused me -
PhoenixB - 22.08.2011
But - why would i need IsPlayerInRangeOfPoint for it as the dialog displays when the player is AT the pickup therefore making IsPlayerInRangeOfPoint not needed
Re: Something that confused me -
Adil - 22.08.2011
The position checker will check if the player is near the Pickup, if he's not, it will reset the JustPicked, making the player able to pick it up again.
Re: Something that confused me -
PhoenixB - 22.08.2011
Can this not be done via JustPicked - me and MadeMan tried to do
GetPvarInt("DialogShown", etc and
SetPvarInt"DialogShown and such but that worked only for the Cancel button but when the player did select it didnt show again until re logging.
Re: Something that confused me -
PhoenixB - 23.08.2011
Bump - Anyone know a way via "DialogShown" - Me and MadeMan did it but it only worked for Cancel button but when Select button, the Dialog was not shown again. It fixed the Solution where the main menu wasnt shown ALL the time and you were supposed to re enter pickup to view it but for Select button you couldnt see the dialog again, only when relog/GMX
Re: Something that confused me -
The.Atom - 25.08.2011
Just onplayerpickup, use a if condition to check if the dialog is already open, just put a variable