help with team colors and skin choosing
#1

hello,i got problem,i got code like that!

Quote:

public OnPlayerRequestClass(playerid, classid)
{
GameTextForPlayer(playerid, "~p~Army", 1500, 14);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2176.9158,-1676.7103,14.6513);
SetPlayerFacingAngle(playerid, 76.9820);
SetPlayerCameraPos(playerid, 2171.0,-1677.0,15.0);
SetPlayerCameraLookAt(playerid, 2171.0,-1677.0,15.0);
SetPlayerColor(playerid,0x9ACD32AA);
SetPlayerTeam(playerid,1);
ApplyAnimation(playerid,"GANGS","DEALER_DEAL",4.1, 1,1,1,1,1);
return 1;

}

how i can make it for 2 skins and other ones should say FBI and be color Blue..how i can do that?
Reply
#2

You can use a switch statement. There's actually an example in one of the modes that comes with the server package. I think it's the A51 break in.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~p~Army", 1500, 14);
            SetPlayerInterior(playerid,0);
            SetPlayerPos(playerid,2176.9158,-1676.7103,14.6513);
            SetPlayerFacingAngle(playerid, 76.9820);
            SetPlayerCameraPos(playerid, 2171.0,-1677.0,15.0);
            SetPlayerCameraLookAt(playerid, 2171.0,-1677.0,15.0);
            SetPlayerColor(playerid,0x9ACD32AA);
            SetPlayerTeam(playerid,1);
            ApplyAnimation(playerid,"GANGS","DEALER_DEAL",4.1,1,1,1,1,1);
        }
        case 1:
        {
          //Do your FBI stuff here
        }
    }
    return 1;
}
Reply
#3

C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\AvsF.pwn(161) : error 002: only a single statement (or expression) can follow each "case"

whats that
Reply
#4

Did you add anything else in?

pawn Код:
switch(statement)
{
   case 0:
   {
      //Your code here
   }
   case 1:
   {
      //Your code here
   }
   //etc..
   //Only cases can go in the switch statement, not anything else
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)