Weird problem. -
Glossy42O - 15.01.2015
Hello,
I have a little weird problem, i used class selection maker it always works but now it's the same, maybe it's the codes problem.
I see only the sea
PHP код:
public OnPlayerRequestClass(playerid,classid)
{
if(GetPlayerSkin(playerid))
{
if(GetPlayerTeam(playerid) == TEAM_BALLAS)
{
SetPlayerPos(playerid, 1980.3785, -1197.6845, 27.2536);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 87.6159);
SetPlayerCameraPos(playerid, 1976.8785, -1193.6845, 28.7536);
SetPlayerCameraLookAt(playerid, 1980.3785, -1197.6845, 27.2536);
return 1;
}
if(GetPlayerTeam(playerid) == TEAM_CHINESE)
{
SetPlayerPos(playerid, 1171.9240, -1442.2540, 45.3524);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 87.4755);
SetPlayerCameraPos(playerid, 1168.4240, -1438.2540, 46.8524);
SetPlayerCameraLookAt(playerid, 1171.9240, -1442.2540, 45.3524);
return 1;
}
if(GetPlayerTeam(playerid) == TEAM_COPS)
{
SetPlayerPos(playerid, 1540.3800, -1627.4621, 13.3828);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 91.3813);
SetPlayerCameraPos(playerid, 1536.8800, -1623.4621, 14.8828);
SetPlayerCameraLookAt(playerid, 1540.3800, -1627.4621, 13.3828);
return 1;
}
if(GetPlayerTeam(playerid) == TEAM_GROVE)
{
SetPlayerPos(playerid, 2494.4997, -1686.3710, 13.5131);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 0.6305);
SetPlayerCameraPos(playerid, 2490.9997, -1682.3710, 15.0131);
SetPlayerCameraLookAt(playerid, 2494.4997, -1686.3710, 13.5131);
return 1;
}
if(GetPlayerTeam(playerid) == TEAM_HOBOS)
{
SetPlayerPos(playerid, 1117.9002, -2036.9073, 78.7500);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 89.8325);
SetPlayerCameraPos(playerid, 1114.4002, -2032.9073, 80.2500);
SetPlayerCameraLookAt(playerid, 1117.9002, -2036.9073, 78.7500);
return 1;
}
if(GetPlayerTeam(playerid) == TEAM_VAGOS)
{
SetPlayerPos(playerid, 2575.4946, -1042.1601, 69.5781);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 353.5356);
SetPlayerCameraPos(playerid, 2571.9946, -1038.1601, 71.0781);
SetPlayerCameraLookAt(playerid, 2575.4946, -1042.1601, 69.5781);
return 1;
}
}
return 1;
}
Re: Weird problem. -
mahdi499 - 15.01.2015
Can i ask how did you define the skins? Since this will only check the player's skin and doesnt actually assign them to the team unless you predefined it somewhere else.
Re: Weird problem. -
Glossy42O - 15.01.2015
That's how
PHP код:
AddPlayerClass(230,1118.2677,-2048.4426,74.4297,264.7455,0,0,0,0,0,0); //
AddPlayerClass(137,1119.9713,-2024.5944,74.4297,270.6989,0,0,0,0,0,0); //
AddPlayerClass(136,1191.3344,-2028.5454,69.0078,267.8789,0,0,0,0,0,0); //
AddPlayerClass(79,1201.1931,-2054.2395,75.4605,268.8187,0,0,0,0,0,0); //Hobos
And so on..
Re: Weird problem. -
mahdi499 - 15.01.2015
I believe that wont work for the reason, that the skin numbers dont hold team information. What i can suggest is a Stock.
pawn Код:
Stock GetTeamSkin(playerid)
{
new team;
new skin = GetPlayerSkin(playerid);
if(skin == 280) //This is an Example
{
team = 2;
}
else if......
{
}
return team;
}
After that you can use it in this way:
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
if(GetTeamSkin(playerid) == 1) // Team Ballas For Example
{
// Do this and this
}
else if(GetTeamSkin(playerid) == 2)
{
// Do That
}
}
I didnt test the code but you get the point.
Re: Weird problem. -
Glossy42O - 15.01.2015
didn't work.
Re: Weird problem. -
Clad - 15.01.2015
You should define the teams and use gTeam
Re: Weird problem. -
Glossy42O - 15.01.2015
I did define the teams, and i HAVE to use gteam ?
Re: Weird problem. -
Glossy42O - 16.01.2015
bump
Re: Weird problem. -
Glossy42O - 18.01.2015
bump
Re: Weird problem. -
Glossy42O - 19.01.2015
bump