OnPlayerRequestClass [Determine Button]
#6

It's not that hard. Just keep track of their last selected classid. If the current classid is higher than the previous one they clicked forward, if it's lower they clicked backward. Of course you would need to take into account that it also wraps around. So if you have classid 299 and the next one is 1 then the player pressed forward but the thing wrapped around.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    static
        lastClass[MAX_PLAYERS];

    if(classid > lastClass[playerid])
    {
        // press forward
    }
    else if(classid < lastClass[playerid])
    {
        // press backward
    }
    lastClass[playerid] = classid;
    return 1;
}
Reply


Messages In This Thread
OnPlayerRequestClass [Determine Button] - by Glad2BeHere - 08.06.2013, 06:04
Re: OnPlayerRequestClass [Determine Button] - by dEcooR - 08.06.2013, 06:59
Re: OnPlayerRequestClass [Determine Button] - by JaKe Elite - 08.06.2013, 07:01
Re: OnPlayerRequestClass [Determine Button] - by S0n1COwnsYou - 08.06.2013, 08:20
Re: OnPlayerRequestClass [Determine Button] - by Glad2BeHere - 08.06.2013, 08:25
Re: OnPlayerRequestClass [Determine Button] - by Vince - 08.06.2013, 10:10

Forum Jump:


Users browsing this thread: 1 Guest(s)