15.08.2012, 20:55
Hi everybody, I'm making a Gang Wars server and I created 6 teams and also I want to Use InterpolateCameraPos for every team and I need different cameras for all teams, when I skip forward skin to see other teams it works fine but when I try to skip backward to choose previous team it doesn't works it reverses only the skin but not the camera. So can somebody help me to fix this problem ?
pawn Код:
//This is teams define
new gTeam[MAX_PLAYERS];
#define TEAM1 0
#define TEAM2 1
#define TEAM3 2
#define TEAM4 3
#define TEAM5 4
#define TEAM6 5
//Cameras
new spawncam1[MAX_PLAYERS];//team1
new spawncam2[MAX_PLAYERS];//team2
new spawncam3[MAX_PLAYERS];//team3
new spawncam4[MAX_PLAYERS];//team4
new spawncam5[MAX_PLAYERS];//team5
new spawncam6[MAX_PLAYERS];//team6
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
switch (classid)
{
case 0://team1
{
if(!spawncam1[playerid])
{
if(classid == 0 )
{
gTeam[playerid] = TEAM1;
GameTextForPlayer(playerid,"~w~TEAM1",2000,5);
SetPlayerPos(playerid, -302.3893,1509.6066,75.3594);
SetPlayerFacingAngle(playerid, 183.8946);
InterpolateCameraPos(playerid, -292.654235, 1387.219238, 74.411315, -302.106994, 1502.626464, 75.093582, 3500);
InterpolateCameraLookAt(playerid, -292.871520, 1392.203491, 74.079528, -302.215362, 1507.620727, 75.308357, 2000);
spawncam1[playerid] = 1;
}
}
}
case 1://TEAM2
{
if(!spawncam2[playerid])
{
if(classid == 1)
{
gTeam[playerid] = TEAM2;
GameTextForPlayer(playerid,"~w~TEAM2",2000,5);
SetPlayerPos(playerid, 1707.5847,-778.5145,70.8594);
SetPlayerFacingAngle(playerid, 355.7978);
InterpolateCameraPos(playerid, 1692.757812, -440.760437, 33.227199, 1707.966796, -772.272521, 71.214279, 4000);
InterpolateCameraLookAt(playerid, 1694.279541, -445.510864, 32.883884, 1707.575805, -777.257080, 71.253509, 3000);
spawncam2[playerid] = 1;
}
}
}
case 2://team2
{
if(!spawncam3[playerid])
{
if(classid == 2)
{
gTeam[playerid] = TEAM3;
GameTextForPlayer(playerid,"~w~TEAM3",2000,5);
SetPlayerPos(playerid, 1553.2665,-1675.6398,16.1953);
SetPlayerFacingAngle(playerid, 90.7717);
InterpolateCameraPos(playerid, 1424.742065, -1628.038208, 42.669399, 1550.459838, -1675.726562, 15.350488, 5000);
InterpolateCameraLookAt(playerid, 1429.421630, -1629.657104, 41.976024, 1555.336669, -1675.803955, 16.450487, 2000);
spawncam3[playerid] = 1;
}
}
}
case 3://team4
{
if(!spawncam4[playerid])
{
if(classid 3)
{
gTeam[playerid] = TEAM4;
GameTextForPlayer(playerid,"~w~TEAM4",2000,5);
SetPlayerPos(playerid, 2045.2543,-1277.4751,37.2494);
SetPlayerFacingAngle(playerid, 5.1110);
InterpolateCameraPos(playerid, 1904.575317, -1119.824829, 41.137989, 2045.562500, -1269.516601, 37.070587, 4000);
InterpolateCameraLookAt(playerid, 1907.945678, -1123.515380, 40.997383, 2045.598754, -1274.495239, 37.530872, 2000);
spawncam4[playerid] = 1;
}
}
}
case 4://team5
{
if(!spawncam5[playerid])
{
if(classid == 4)
{
gTeam[playerid] = TEAM5;
GameTextForPlayer(playerid,"~w~TEAM5",2000,5);
SetPlayerPos(playerid, 1924.1725,-1418.6702,16.3594);
SetPlayerFacingAngle(playerid, 187.0129);
InterpolateCameraPos(playerid, 1991.101440, -1463.010742, 35.778854, 1925.682861, -1423.050170, 15.949052, 3000);
InterpolateCameraLookAt(playerid, 1987.193725, -1460.087646, 34.689994, 1924.923828, -1418.108154, 15.972490, 2000);
spawncam5[playerid] = 1;
}
}
}
case 5://team6
{
if(!spawncam6[playerid])
{
if(classid == 5 )
{
gTeam[playerid] = TEAM6;
GameTextForPlayer(playerid,"~w~team6",2000,5);
SetPlayerPos(playerid, 1279.3579,-812.7130,89.8152);
SetPlayerFacingAngle(playerid, 359.1848);
InterpolateCameraPos(playerid, 1540.089843, -924.312866, 86.327468, 1278.101196, -804.776733, 90.334152, 4000);
InterpolateCameraLookAt(playerid, 1535.813110, -921.729431, 86.514923, 1278.412719, -809.764221, 90.166213, 3500);
spawncam6[playerid] = 1;
}
}
}
}
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0 )
{
gTeam[playerid] = TEAM1;
}
else if(classid == 1)
{
gTeam[playerid] = TEAM2;
}
else if(classid == 2)
{
gTeam[playerid] = TEAM3;
}
else if(classid == 3)
{
gTeam[playerid] = TEAM4;
}
else if(classid == 4)
{
gTeam[playerid] = TEAM5;
}
else if(classid == 5)
{
gTeam[playerid] = TEAM6;
}
}
public OnPlayerConnect(playerid)
{
spawncam1[playerid] = 0;
spawncam2[playerid] = 0;
spawncam3[playerid] = 0;
spawncam4[playerid] = 0;
spawncam5[playerid] = 0;
spawncam6[playerid] = 0;
return 1;
}