OnPlayerRequestClass [Determine Button]
#1

Is there a way to determine whether the player pressed the back button or forward button ?
Reply
#2

In requestclass? Backbutton ? This is 0.3x welcome
Reply
#3

You can't detect it.
However, you can detect it (But both of them) which is the OnPlayerRequestClass.
You can detect if player click spawn button which is the OnPlayerRequestSpawn.
Reply
#4

Glad2BeHere, of you want to detect "<<" & ">>"

Create a custom OnPlayerRequestClass with clickable textdraws(Buttons)
Reply
#5

bleh.......... the was open Z... i didn't want to go there
Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)