Spawn Bug -
anassmaroc - 21.09.2015
Hi ALl. i Have Problйm in Spawn Player i've add randomPlayerSpawn But it's Don't Work
it's Spawning Here.
Код:
AddPlayerClass(0,131.3964,-69.7172,1.5781,182.7008,0,0,0,0,0,0); //
Full Code
Код:
new Float:RandomPlayerSpawns[][] =
{
{2451.5474,-2020.9169,13.5469,341.4067}, // Randomspawn lva
{1606.9009,1826.6042,10.8203,347.5937}, // Randomspawn aa
{1248.5216,251.1522,19.5547,32.4184}, // Randomspawn sfa
{-2725.4590,-313.1409,7.1875,45.0576}, // randomspawn lsa
{484.7791,-1464.4720,18.6131,301.9811}, // randomspawn lv
{-1858.4734,-1650.4854,26.6446,124.1645}, // randomspawn sf
{671.6703,-610.4697,16.3359,334.4921}, // randomspawn ls
{1384.9999,-955.8557,34.3933,14.6513},
{-2521.3293,1215.9065,37.4283,266.6969}, // randomspawn sf
{2107.7537,1000.6898,11.0094,0.1267}, // randomspawn ls
{2646.2292,2225.8186,10.8060,180.7247}, // randomspawn ls
{1249.7258, -2047.9263, 59.9209, 90.2055}, // Randomspawn
{1241.2084, -2057.6521, 60.0190, 94.9352}, // Randomspawn
{1241.0105, -2052.6873, 59.9975, 2.8144}, // Randomspawn
{718.4906, -1477.3024, 5.4688, 357.9947}, // Randomspawn
{722.3772, -1477.2856, 5.4688, 272.3814}, // Randomspawn
{-2076.0566,1421.1305,7.1007,176.6188},
{-2108.3713,903.5490,76.6209,353.5211},
{1454.8717,2346.8708,10.8203,177.7089},
{1055.0553,1401.2302,5.8203,357.6070},
{1830.2111,-1604.7515,13.5469,121.5940},
{2443.3550,-1644.4709,13.4693,175.4878}
};
OnPlayerSpawn(playerid)
Код:
new Random = random(sizeof(RandomPlayerSpawns));
SetPlayerPos(playerid, RandomPlayerSpawns[Random][0], RandomPlayerSpawns[Random][1], RandomPlayerSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomPlayerSpawns[Random][3]);
Maybe it's From here
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,-1854,510.39999389648,108.40000152588);
SetPlayerFacingAngle(playerid,172.007324);
SetPlayerCameraPos(playerid, -1862.1560, 500.0932, 109.0720);
SetPlayerCameraLookAt(playerid, -1861.4960, 500.8430, 109.1420);
return 1;
}
Re: Spawn Bug -
IceBilizard - 21.09.2015
Try this.
First of all
pawn Код:
enum RandSpawn
{
Float:XPOS,
Float:YPOS,
Float:ZPOS,
Float:Angle,
};
then
pawn Код:
new Float:RandomPlayerSpawns[][RandSpawn] =
{
{2451.5474,-2020.9169,13.5469,341.4067}, // Randomspawn lva
{1606.9009,1826.6042,10.8203,347.5937}, // Randomspawn aa
{1248.5216,251.1522,19.5547,32.4184}, // Randomspawn sfa
{-2725.4590,-313.1409,7.1875,45.0576}, // randomspawn lsa
{484.7791,-1464.4720,18.6131,301.9811}, // randomspawn lv
{-1858.4734,-1650.4854,26.6446,124.1645}, // randomspawn sf
{671.6703,-610.4697,16.3359,334.4921}, // randomspawn ls
{1384.9999,-955.8557,34.3933,14.6513},
{-2521.3293,1215.9065,37.4283,266.6969}, // randomspawn sf
{2107.7537,1000.6898,11.0094,0.1267}, // randomspawn ls
{2646.2292,2225.8186,10.8060,180.7247}, // randomspawn ls
{1249.7258, -2047.9263, 59.9209, 90.2055}, // Randomspawn
{1241.2084, -2057.6521, 60.0190, 94.9352}, // Randomspawn
{1241.0105, -2052.6873, 59.9975, 2.8144}, // Randomspawn
{718.4906, -1477.3024, 5.4688, 357.9947}, // Randomspawn
{722.3772, -1477.2856, 5.4688, 272.3814}, // Randomspawn
{-2076.0566,1421.1305,7.1007,176.6188},
{-2108.3713,903.5490,76.6209,353.5211},
{1454.8717,2346.8708,10.8203,177.7089},
{1055.0553,1401.2302,5.8203,357.6070},
{1830.2111,-1604.7515,13.5469,121.5940},
{2443.3550,-1644.4709,13.4693,175.4878}
};
new Float:PlayerPos[4];
then
pawn Код:
new randomspawn = random(sizeof(RandomPlayerSpawns));
PlayerPos[0] = RandomPlayerSpawns[randomspawn][XPOS];
PlayerPos[1] = RandomPlayerSpawns[randomspawn][YPOS];
PlayerPos[2] = RandomPlayerSpawns[randomspawn][ZPOS];
PlayerPos[3] = RandomPlayerSpawns[randomspawn][TrAngle];
SetPlayerPos(playerid,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
SetPlayerFacingAngle(playerid, PlayerPos[3]);
SetCameraBehindPlayer(playerid);
Re : Re: Spawn Bug -
anassmaroc - 21.09.2015
pawn Код:
new randomspawn = random(sizeof(RandomPlayerSpawns));
PlayerPos[0] = RandomPlayerSpawns[randomspawn][XPOS];
PlayerPos[1] = RandomPlayerSpawns[randomspawn][YPOS];
PlayerPos[2] = RandomPlayerSpawns[randomspawn][ZPOS];
PlayerPos[3] = RandomPlayerSpawns[randomspawn][TrAngle];
SetPlayerPos(playerid,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
SetPlayerFacingAngle(playerid, PlayerPos[3]);
SetCameraBehindPlayer(playerid);
[/QUOTE]
Where i Must add this ?
Re: Spawn Bug -
IceBilizard - 21.09.2015
onplayerspawn
EDIT:
change the line
pawn Код:
PlayerPos[3] = RandomPlayerSpawns[randomspawn][TrAngle];
to
pawn Код:
PlayerPos[3] = RandomPlayerSpawns[randomspawn][Angle];
Re : Spawn Bug -
anassmaroc - 21.09.2015
Man I Can't Understand Explain Better
Re: Spawn Bug -
IceBilizard - 21.09.2015
Added instructions
pawn Код:
//Add This at top of script or at where you are making enums
enum RandSpawn
{
Float:XPOS,
Float:YPOS,
Float:ZPOS,
Float:Angle,
};
then
pawn Код:
//Add This at center of script
new Float:RandomPlayerSpawns[][RandSpawn] =
{
{2451.5474,-2020.9169,13.5469,341.4067}, // Randomspawn lva
{1606.9009,1826.6042,10.8203,347.5937}, // Randomspawn aa
{1248.5216,251.1522,19.5547,32.4184}, // Randomspawn sfa
{-2725.4590,-313.1409,7.1875,45.0576}, // randomspawn lsa
{484.7791,-1464.4720,18.6131,301.9811}, // randomspawn lv
{-1858.4734,-1650.4854,26.6446,124.1645}, // randomspawn sf
{671.6703,-610.4697,16.3359,334.4921}, // randomspawn ls
{1384.9999,-955.8557,34.3933,14.6513},
{-2521.3293,1215.9065,37.4283,266.6969}, // randomspawn sf
{2107.7537,1000.6898,11.0094,0.1267}, // randomspawn ls
{2646.2292,2225.8186,10.8060,180.7247}, // randomspawn ls
{1249.7258, -2047.9263, 59.9209, 90.2055}, // Randomspawn
{1241.2084, -2057.6521, 60.0190, 94.9352}, // Randomspawn
{1241.0105, -2052.6873, 59.9975, 2.8144}, // Randomspawn
{718.4906, -1477.3024, 5.4688, 357.9947}, // Randomspawn
{722.3772, -1477.2856, 5.4688, 272.3814}, // Randomspawn
{-2076.0566,1421.1305,7.1007,176.6188},
{-2108.3713,903.5490,76.6209,353.5211},
{1454.8717,2346.8708,10.8203,177.7089},
{1055.0553,1401.2302,5.8203,357.6070},
{1830.2111,-1604.7515,13.5469,121.5940},
{2443.3550,-1644.4709,13.4693,175.4878}
};
new Float:PlayerPos[4];
then
pawn Код:
public OnPlayerSpawn(playerid)
{
new randomspawn = random(sizeof(RandomPlayerSpawns));
PlayerPos[0] = RandomPlayerSpawns[randomspawn][XPOS];
PlayerPos[1] = RandomPlayerSpawns[randomspawn][YPOS];
PlayerPos[2] = RandomPlayerSpawns[randomspawn][ZPOS];
PlayerPos[3] = RandomPlayerSpawns[randomspawn][Angle];
SetPlayerPos(playerid,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
SetPlayerFacingAngle(playerid, PlayerPos[3]);
SetCameraBehindPlayer(playerid);
return 1;
}
Re : Spawn Bug -
anassmaroc - 21.09.2015
and In OnPlayerRequestClass what i will do?
Re: Spawn Bug -
IceBilizard - 21.09.2015
nothing its for class selection
Re : Spawn Bug -
anassmaroc - 21.09.2015
Don't Work
Re: Re : Spawn Bug -
IceBilizard - 21.09.2015
Quote:
Originally Posted by anassmaroc
Don't Work 
|
You are using SetSpawnInfo in your script?