SA-MP Forums Archive
Previous button In OnPlayerRequestClass - 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: Previous button In OnPlayerRequestClass (/showthread.php?tid=320902)



Previous button In OnPlayerRequestClass - LuisGraph - 25.02.2012

Hello, їhow to detect when I give push to the button back OnPlayerRequestClass

pawn Код:
new count[MAX_PLAYERS];
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(count[playerid])
    {
        case 0: {SendClientMessage(playerid, -1, "1"); count[playerid]++;}
           case 1: {SendClientMessage(playerid, -1, "2");}
    }
    return 1;
}
I want to press the button backward, you subtract the count variable.



pawn Код:
count[playerid]--;
їHow to make?


Re: Previous button In OnPlayerRequestClass - MP2 - 25.02.2012

Store the classid in a global array. If it's less than the previous class they pressed <<, else if it is higher then pressed >>.


Respuesta: Previous button In OnPlayerRequestClass - LuisGraph - 25.02.2012

Tankz Man.

EDIT: Resolved