Again I need help.
#1

Here's the improved version of the team colors:

pawn Код:
#define TEAM_ROBBERS 8
#define TEAM_COPS 9

public OnPlayerRequestClass(playerid, classid)
{
        SetPlayerTeamFromClass(playerid, classid);
    SetPlayerPos(playerid, -2556.3979,1217.2249,42.1484);
    SetPlayerFacingAngle(playerid,9.1927);
    SetPlayerCameraPos(playerid, -2556.9431,1224.0414,42.1484);
    SetPlayerCameraLookAt(playerid,-2556.3979,1217.2249,42.1484);

    return 1;
}



public OnPlayerSpawn(playerid)
{
        SetPlayerToTeamColor(playerid);//Line 188
    return 1;
}

SetPlayerTeamFromClass(playerid,classid)
{
   new gTeam[MAX_PLAYERS];
   switch(classid)
   {
      case 0:
      {
             if(classid == 98)
              {
                 gTeam[playerid] = TEAM_ROBBERS;
              }
      }
      case 1:
      {
             if(classid == 100)
              {
                 gTeam[playerid] = TEAM_ROBBERS;
              }
       }
      case 2:
      {
              if(classid == 101)
              {
                 gTeam[playerid] = TEAM_ROBBERS;
              }
      }
      case 3:
      {
              if(classid == 284)
              {
                 gTeam[playerid] = TEAM_COPS;
              }
      }
      case 4:
      {
              if(classid == 285)
              {
                 gTeam[playerid] = TEAM_COPS;
              }
      }
      case 5:
      {
              if(classid == 286)
              {
                 gTeam[playerid] = TEAM_COPS;
              }
      }
   }
}

SetPlayerToTeamColor(playerid,classid)
{
   new gTeam[MAX_PLAYERS];
   if(gTeam[playerid] == TEAM_ROBBERS)
   {
      SetPlayerColor(playerid,WHITE);
   }
   else if(gTeam[playerid] == TEAM_COPS)
   {
      SetPlayerColor(playerid,BLUE);
   }
}

             
SetPlayerTeamFromClass(playerid,classid)
{
   new gTeam[MAX_PLAYERS];
   switch(classid)
   {
      case 0:
      {
             if(classid == 98)
              {
                 gTeam[playerid] = TEAM_ROBBERS;
              }
      }
      case 1:
      {
             if(classid == 100)
              {
                 gTeam[playerid] = TEAM_ROBBERS;
              }
       }
      case 2:
      {
              if(classid == 101)
              {
                 gTeam[playerid] = TEAM_ROBBERS;
              }
      }
      case 3:
      {
              if(classid == 284)
              {
                 gTeam[playerid] = TEAM_COPS;
              }
      }
      case 4:
      {
              if(classid == 285)
              {
                 gTeam[playerid] = TEAM_COPS;
              }
      }
      case 5:
      {
              if(classid == 286)
              {
                 gTeam[playerid] = TEAM_COPS;
              }
      }
   }
}

SetPlayerToTeamColor(playerid,classid) //Line 828
{
   new gTeam[MAX_PLAYERS];
   if(gTeam[playerid] == TEAM_ROBBERS)
   {
      SetPlayerColor(playerid,WHITE);
   }
   else if(gTeam[playerid] == TEAM_COPS)
   {
      SetPlayerColor(playerid,BLUE);
   }
}
2 warnings when compiling:
Код:
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(188) : warning 202: number of arguments does not match definition
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(828) : warning 203: symbol is never used: "classid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
How to solve the warnings(and I went to game but still not working)
Reply
#2

i don't think that code works , if u have skype , xfire pm me and i'll give u a working one
Reply
#3

What have you done with the code I gave? You messed it up
Reply
#4

Your code was also not working xir
Reply
#5

the problem is the function SetPlayerToTeamColor, you added a parameter and didn't used it:
pawn Код:
SetPlayerToTeamColor(playerid) //Line 828
{
   new gTeam[MAX_PLAYERS];
   if(gTeam[playerid] == TEAM_ROBBERS)
   {
      SetPlayerColor(playerid,WHITE);
   }
   else if(gTeam[playerid] == TEAM_COPS)
   {
      SetPlayerColor(playerid,BLUE);
   }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)