public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
}
SetPlayerTeamFromClass(playerid, classid)// this is not a native function
{
switch(classid) // it switches through classids
{
case 0: // classid 0
{
gTeam[playerid] = TEAM_GROVE; // it sets the data of the player who selected the first team (in the gTeam array) to TEAM_GROVE
{
SetPlayerColor(playerid,TEAM_GROVE_COLOR);
}
}
case 1: // classid 1
{
gTeam[playerid] = TEAM_BALLAS; // it sets the data of the player who selected the second team (in the gTeam array) to TEAM_BALLAS
{
SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
}
}
}
}
return 1;
}
.pwn(79) : error 010: invalid function or declaration
return 1;
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 0:
{
gTeam[playerid] = TEAM_GROVE;
SetPlayerColor(playerid,TEAM_GROVE_COLOR);
}
case 1:
{
gTeam[playerid] = TEAM_BALLAS;
SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
}
}
return 1;
}
|
try this:
pawn Код:
|