Class Selection Without AddPlayerClass?
#1

Heey all,

I made a class selection without AddPlayerClass.
But how can i make if the player reached the max case(last class skin) it will be switched to case 0(first class skin).
For Test i made 3 classes.
Код:
public OnPlayerRequestClass(playerid, classid)
{
	
 	switch(classid)
	{
		case 0://1 needs to be 0
		{
			SetPlayerSkin(playerid,0);
		}
		case 1:
		{
			SetPlayerSkin(playerid,1);
		}
		case 2:
		{
			SetPlayerSkin(playerid,2);
		}
	}
	return 1;
}
How i can reset the class selection(to case 0 if reached case 2)?

Thanks Admigo
Reply
#2

Try this, at the top of OnPlayerRequestClass
pawn Код:
if( classid > 2 ) classid = 0;
Reply
#3

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Try this, at the top of OnPlayerRequestClass
pawn Код:
if( classid > 2 ) classid = 0;
Dont work,it switch me to CJ Skin and then when i choose next skin its still CJ:S
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
"classid" is the currently selected class as defined by "AddPlayerClass" - if you have none of those you have no "classid", and thus you will only ever have it called with "0".

If you want more advanced control of class selection I suggest you check out y_classes - that can add and remove classes for players dynamically (and if you don't want those sorts of features, why are you not using "AddPlayerClass" in the first place)?
Can you give a example of your script what i want?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)