Need Some Help.
#2

It depends on the order of which you added the characters (AddPlayerClass lines) to the script. For example, if the Army is your first AddPlayerClass line, you could use the following code:
pawn Код:
public OnPlayerRequestClass( playerid, classid ) {

   switch( classid ) {

      case 0: GameTextForPlayer( playerid, "~g~Army", 4000, 5 );
      case 1: GameTextForPlayer( playerid, "~b~FBI", 4000, 5 );
   }
   return 1;
}
A couple notable links to look at:

OnPlayerRequestClass callback - This function is called when the player enters class selection and each time they press a button while in class selection
GameTextForPlayer function - Displays game text to the player's screen

If you need a little explanation on any of the above code, please ask. It's always better to understand the code than to just plug it into your script.

As an alternative, you could also use GetPlayerSkin() to compare the skin, and then display the game text. However, that would be slightly less efficient.
Reply


Messages In This Thread
Need Some Help. - by Bmxerlmao5288 - 12.06.2011, 01:33
Re: Need Some Help. - by Bakr - 12.06.2011, 02:42

Forum Jump:


Users browsing this thread: 1 Guest(s)