06.10.2009, 22:55
Hey,
I've read This Tutorial(Hope it works for 0.3),
And i've tried my luck with the SetPlayerTeamFromClass.
Well,i see it didnt go well(Extremely Wrong)
I've searched but i didnt find an answer that satisfying my problem Solution.
Well..The code:
On the top
OnGameModeInit:
OnPlayerRequestClass...
Function in the End of the script:
Well,There are no compiling errors,But when i'm going InGame i cant switch charecters -.-'
I didnt have that problem Before i added all Of The "Making a basic deathmatch" Shit.
Help Extremely appreciated.
I've read This Tutorial(Hope it works for 0.3),
And i've tried my luck with the SetPlayerTeamFromClass.
Well,i see it didnt go well(Extremely Wrong)
I've searched but i didnt find an answer that satisfying my problem Solution.
Well..The code:
On the top
pawn Код:
#define TEAM_USA 0
#define TEAM_SPAIN 1
#define TEAM_FRANCE 2
#define TEAM_CHINA 3
pawn Код:
new gTeam[MAX_PLAYERS];
pawn Код:
//Area 51 team-USA
AddPlayerClass(287,204.0314,1883.2047,17.6481,359.1003,29,450,30,310,24,535); // A51 Spawn CASE 0
AddPlayerClass(286,204.0314,1883.2047,17.6481,359.1003,29,450,30,310,24,535); // A51 Spawn CASE 1
AddPlayerClass(285,204.0314,1883.2047,17.6481,359.1003,29,450,30,310,24,535); // A51 Spawn CASE 2
//Vilage forces-SPAIN
AddPlayerClass(287,-822.4015,2764.9468,46.0000,184.2325,22,535,33,160,31,270); // Spanish spawn CASE 3
AddPlayerClass(286,-822.4015,2764.9468,46.0000,184.2325,22,535,33,160,31,270); // Spanish spawn CASE 4
AddPlayerClass(285,-822.4015,2764.9468,46.0000,184.2325,22,535,33,160,31,270); // Spanish spawn CASE 5
//Side forces-FRANCE
AddPlayerClass(287,-614.7703,2708.8726,72.3750,179.5655,23,535,26,270,29,353); // French spawn CASE 6
AddPlayerClass(286,-614.7703,2708.8726,72.3750,179.5655,23,535,26,270,29,353); // French spawn CASE 7
AddPlayerClass(285,-614.7703,2708.8726,72.3750,179.5655,23,535,26,270,29,353); // French spawn CASE 8
//Airport protection-CHINA
AddPlayerClass(287,-27.0539,2326.4404,24.1406,350.7502,34,160,25,165,16,50); // Chinese team Spawn CASE 9
AddPlayerClass(286,-27.0539,2326.4404,24.1406,350.7502,34,160,25,165,16,50); // Cinese team Spawn CASE 10
AddPlayerClass(285,-27.0539,2326.4404,24.1406,350.7502,34,160,25,165,16,50); // Chinese team Spawn CASE 11
SetTeamCount(4);
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
switch(classid){
case 0:
{
SetPlayerPos(playerid,214.7366,1865.6632,13.1406);
SetPlayerFacingAngle(playerid,0.5259);
SetPlayerCameraPos(playerid,215.6613,1872.5498,13.1406);
SetPlayerCameraLookAt(playerid,214.7366,1865.6632,13.1406);
GameTextForPlayer(playerid,"~r~AREA 51 FORCES-USA",5000,4);
SetPlayerColor(playerid,0xFF0000FF);
}
case 2:
{
SetPlayerPos(playerid,214.7366,1865.6632,13.1406);
SetPlayerFacingAngle(playerid,0.5259);
SetPlayerCameraPos(playerid,215.6613,1872.5498,13.1406);
SetPlayerCameraLookAt(playerid,214.7366,1865.6632,13.1406);
GameTextForPlayer(playerid,"~r~AREA 51 FORCES-USA",5000,4);
SetPlayerColor(playerid,0xFF0000FF);
}
case 3:
{
SetPlayerPos(playerid,-821.8885,2765.8196,46.0000);
SetPlayerFacingAngle(playerid,170.8882);
SetPlayerCameraPos(playerid,-822.6266,2757.2876,45.8516);
SetPlayerCameraLookAt(playerid,-821.8885,2765.8196,46.0000);
GameTextForPlayer(playerid,"~G~Village forces-SPAIN",5000,4);
SetPlayerColor(playerid,0xFFFF00FF);
}
case 5:
{
SetPlayerPos(playerid,-821.8885,2765.8196,46.0000);
SetPlayerFacingAngle(playerid,170.8882);
SetPlayerCameraPos(playerid,-822.6266,2757.2876,45.8516);
SetPlayerCameraLookAt(playerid,-821.8885,2765.8196,46.0000);
GameTextForPlayer(playerid,"~G~Village forces-SPAIN",5000,4);
SetPlayerColor(playerid,0xFFFF00FF);
}
case 6:
{
SetPlayerPos(playerid,-614.7703,2708.8726,72.3750);
SetPlayerFacingAngle(playerid,179.5655);
SetPlayerCameraPos(playerid,-614.6206,2703.2019,72.3750);
SetPlayerCameraLookAt(playerid,-614.7703,2708.8726,72.3750);
GameTextForPlayer(playerid,"~B~Side forces-FRANCE",5000,4);
SetPlayerColor(playerid,0x0000FFFF);
}
case 8:
{
SetPlayerPos(playerid,-614.7703,2708.8726,72.3750);
SetPlayerFacingAngle(playerid,179.5655);
SetPlayerCameraPos(playerid,-614.6206,2703.2019,72.3750);
SetPlayerCameraLookAt(playerid,-614.7703,2708.8726,72.3750);
GameTextForPlayer(playerid,"~B~Side forces-FRANCE",5000,4);
SetPlayerColor(playerid,0x0000FFFF);
}
case 9:
{
SetPlayerPos(playerid,-27.8519,2325.9814,24.1406);
SetPlayerFacingAngle(playerid,359.7351);
SetPlayerCameraPos(playerid,-27.9873,2329.9561,24.1406);
SetPlayerCameraLookAt(playerid,-27.8519,2325.9814,24.1406);
GameTextForPlayer(playerid,"~P~Airport Protection FORCES-china",5000,4);
SetPlayerColor(playerid,0x00FF00FF);
}
case 11:
{
SetPlayerPos(playerid,-27.8519,2325.9814,24.1406);
SetPlayerFacingAngle(playerid,359.7351);
SetPlayerCameraPos(playerid,-27.9873,2329.9561,24.1406);
SetPlayerCameraLookAt(playerid,-27.8519,2325.9814,24.1406);
GameTextForPlayer(playerid,"~P~Airport Protection FORCES-china",5000,4);
SetPlayerColor(playerid,0x00FF00FF);
}
}
}
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_USA;
}
if (classid == 1)
{
gTeam[playerid] = TEAM_USA;
}
if (classid == 2)
{
gTeam[playerid] = TEAM_USA;
}
else
{
if (classid == 3)
{
gTeam[playerid] = TEAM_SPAIN;
}
if (classid == 4)
{
gTeam[playerid] = TEAM_SPAIN;
}
if (classid == 5)
{
gTeam[playerid] = TEAM_SPAIN;
}
else
{
if (classid == 6)
{
gTeam[playerid] = TEAM_FRANCE;
}
if (classid == 7)
{
gTeam[playerid] = TEAM_FRANCE;
}
if (classid == 8)
{
gTeam[playerid] = TEAM_FRANCE;
}
else
{
if (classid == 9)
{
gTeam[playerid] = TEAM_CHINA;
}
if (classid == 10)
{
gTeam[playerid] = TEAM_CHINA;
}
if (classid == 11)
{
gTeam[playerid] = TEAM_CHINA;
}
}
}
}
}
I didnt have that problem Before i added all Of The "Making a basic deathmatch" Shit.
Help Extremely appreciated.