08.09.2011, 19:25
pawn Code:
forward SetPlayerTeamFromClass(playerid, classid);
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = TEAM_WORKERS;
GameTextForPlayer(playerid,"~g~Workers",10,0);
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_AGENTS;
GameTextForPlayer(playerid,"~r~Agents",10,0);
}
return 1;
}
pawn Code:
forward SetPlayerTeamFromClass(playerid, classid);
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = TEAM_WORKERS;
GameTextForPlayer(playerid,"~g~Workers",10,0);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_AGENTS;
GameTextForPlayer(playerid,"~r~Agents",10,0);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
}
return 1;
}