SA-MP Forums Archive
Small question - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Small question (/showthread.php?tid=270709)



Small question - FireCat - 21.07.2011

How could I like, know if the player clicked on the listitem 65 without having to do
if(listitem == 0)
{
}

if(listitem == 1)
{
}

Like for example a GetClickedListItem
Is it possible?


Re: Small question - Norck - 21.07.2011

Quote:

Like for example a GetClickedListItem
Is it possible?

Nope, but you can use switch, it's more better for 65 items than if-else construction
Example:
pawn Код:
switch(listitem)
{
    case 0:    //    first list item
    {
    }
    case 1:    //    second list item
    {
    }
    // ...
    case 64:   //    65th listitem
    {
    }
}