25.04.2011, 16:35
Here's the improved version of the team colors:
2 warnings when compiling:
How to solve the warnings(and I went to game but still not working)
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);
}
}
Код:
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