28.05.2010, 17:01
I use an array to store the sets of coordinates per class.
That's what I'm using (for a more dynamic type of way)
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);
}