SetPlayerPos won't work under OnPlayerRequestClass
#7

I use an array to store the sets of coordinates per class.

pawn Код:
enum E_CLASS_DATA
{
    SkinID,
    Float:PlayerPosX,
    Float:PlayerPosY,
    Float:PlayerPosZ,
    Float:PlayerPosA,
    Float:SpawnX,
    Float:SpawnY,
    Float:SpawnZ,
    Float:SpawnA,
    Float:CamPosX,
    Float:CamPosY,
    Float:CamPosZ,
    Text[128],
}

new cData[][E_CLASS_DATA] =
{
    {105, 2457.687500, -1677.946533, 13.504999, 67.715721, 2495.215332, -1686.504882, 13.513961, 4.950347, 2454.773437, -1676.751342, 13.502408, "~n~~n~~g~Grove Street"},
    {106, 2457.687500, -1677.946533, 13.504999, 67.715721, 2495.215332, -1686.504882, 13.513961, 4.950347, 2454.773437, -1676.751342, 13.502408, "~n~~n~~g~Grove Street"},
    {107, 2457.687500, -1677.946533, 13.504999, 67.715721, 2495.215332, -1686.504882, 13.513961, 4.950347, 2454.773437, -1676.751342, 13.502408, "~n~~n~~g~Grove Street"}
};
pawn Код:
public OnGameModeInit()
{
for(new g; g < sizeof(cData); g++)
    {
      AddPlayerClass(cData[g][SkinID], cData[g][SpawnX], cData[g][SpawnY], cData[g][SpawnZ], cData[g][SpawnA], 0, 0, 0, 0, 0, 0);
      return 1;
    }
return 1;
}
pawn Код:
stock ClassSelection(playerid)
{
  for(new g; g < sizeof(cData[]); g++)
    {
      SetPlayerPos(playerid, cData[g][PlayerPosX], cData[g][PlayerPosY], cData[g][PlayerPosX]);
        SetPlayerFacingAngle(playerid, cData[g][PlayerPosA]);
      SetPlayerCameraPos(playerid, cData[g][CamPosX], cData[g][CamPosY], cData[g][CamPosZ]);
      SetPlayerCameraLookAt(playerid, cData[g][PlayerPosX], cData[g][PlayerPosY], cData[g][PlayerPosZ]);
      GameTextForPlayer(playerid, cData[g][Text], 3000, 4);
    }
}

public OnPlayerRequestClass(playerid, classid)
{
    ClassSelection(playerid);
 
}
That's what I'm using (for a more dynamic type of way)
Reply


Messages In This Thread
SetPlayerPos won't work under OnPlayerRequestClass - by Joe_ - 28.05.2010, 15:58
Re: SetPlayerPos won't work under OnPlayerRequestClass - by Flashy - 28.05.2010, 16:09
Re: SetPlayerPos won't work under OnPlayerRequestClass - by Joe_ - 28.05.2010, 16:10
Re: SetPlayerPos won't work under OnPlayerRequestClass - by playbox12 - 28.05.2010, 16:24
Re: SetPlayerPos won't work under OnPlayerRequestClass - by DJDhan - 28.05.2010, 16:50
Re: SetPlayerPos won't work under OnPlayerRequestClass - by [XST]O_x - 28.05.2010, 16:53
Re: SetPlayerPos won't work under OnPlayerRequestClass - by Joe_ - 28.05.2010, 17:01

Forum Jump:


Users browsing this thread: 2 Guest(s)