-
Sziasztok
A szerverem gamemodjából szeretném kivenni a RandomSpawnt tehát hogy ne véletlenszerû helyekre spawnoljon hanem csak 1re
Valaki megtudná nekem oldani,hogy csak 1 helyre spawnoljon?
Kód:
new Float:RandomSpawn[][7] =
{
{-628.202636,872.717712,1.834375,90.0}, // Csak az itt lévõ koordinátára spawnoljon
{2082.343261,1286.864746,10.820312,90.0}, // Randomspawn
{1874.276367, -1394.703491, 13.610312,90.0}, // Randomspawn
{2494.894531, -1688.636352, 13.930054,90.0}, // Randomspawn
{2057.295654, 843.364379, 6.703125,90.0}, // Randomspawn
{-1984.846069, 172.829696, 27.687500,90.0}
};
new rand = random(sizeof(RandomSpawn));
// SetPlayerPos to the random spawn data
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
// SetPlayerFacingAngle to the random facing angle data
SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);}
SetPlayerHealth(playerid,100);
return 1;
}
UI: Az elõzõ ilyen témámat a Szkript kérésekbõl törölje a moderátor,köszi :D
-
Az egészet töröld
és ezt tedd bele az onplayerspawn be
SetPlayerPos(playerid, -628.202636,872.717712,1.834375);
-
Sajnos nem vállt be..nemtom miért de nekem 26 errort adott ki utána..
Az úgy mûködni fog,hogyha randomspawn-nak csak 1 helyet adok meg?
-
new Float:RandomSpawn[][1] =
{
{-628.202636,872.717712,1.834375,90.0} // Csak az itt lévõ koordinátára spawnoljon
};
new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand][0]);
SetPlayerFacingAngle(playerid, RandomSpawn[rand][0]);}
SetPlayerHealth(playerid,100);
return 1;
}
Így mûködni fog!
De így is mûködnie kell!
public OnPlayerSpawn(playerid)
{
SetPlayerFacingAngle(playerid, 90);
SetPlayerPos(playerid, -628.202636,872.717712,1.834375);
return 1;
}
-
Mind2 re errort ad ki :(
Dupla hozzászólás automatikusan összefûzve. ( 2014. június 23. - 09:28:47 )
Megadom a teljes kódrészletet hátha segít :D
public OnPlayerSpawn(playerid)
{
if(MiniGame[playerid] == 1)
{
if(Tipo[playerid] == 1)
{
new rand = random(sizeof(RandomMini1));
SetPlayerPos(playerid, RandomMini1[rand][0], RandomMini1[rand][1],RandomMini1[rand][2]);
GivePlayerWeapon(playerid, 38, 999999);
}
else if(Tipo[playerid] == 2)
{
new rand = random(sizeof(RandomMini2));
SetPlayerPos(playerid, RandomMini2[rand][0], RandomMini2[rand][1],RandomMini2[rand][2]);
CargarObjetos(playerid);
GivePlayerWeapon(playerid, 38, 999999);
}
else if(Tipo[playerid] == 3)
{
if(Equipo[playerid] == 1)
{
SetPlayerPos(playerid,7714.453125,-2599.890380,24.106107),CargarObjetos(playerid);
GivePlayerWeapon(playerid,29,999999);
GivePlayerWeapon(playerid,30,999999);
GivePlayerWeapon(playerid,31,999999);
new SkinArray[3] = {
285,
287,
280
};
new rand = random(sizeof(SkinArray));
SetPlayerSkin(playerid,SkinArray[rand]);
}
else if(Equipo[playerid] == 2)
{
new SkinArray1[3] = {
28,
29,
30,
};
new rand1 = random(sizeof(SkinArray1));
SetPlayerSkin(playerid,SkinArray1[rand1]);
SetPlayerPos(playerid,7808.556152,-2665.601074,12.653361),CargarObjetos(playerid);
GivePlayerWeapon(playerid,29,999999);
GivePlayerWeapon(playerid,30,999999);
GivePlayerWeapon(playerid,31,999999);
}
}
}
else if(MiniGame[playerid] == 0){
new Float:RandomSpawn[][7] =
{
{-628.202636,872.717712,1.834375,90.0}, // Randomspawn
{2082.343261,1286.864746,10.820312,90.0}, // Randomspawn
{1874.276367, -1394.703491, 13.610312,90.0}, // Randomspawn
{2494.894531, -1688.636352, 13.930054,90.0}, // Randomspawn
{2057.295654, 843.364379, 6.703125,90.0}, // Randomspawn
{-1984.846069, 172.829696, 27.687500,90.0}
};
new rand = random(sizeof(RandomSpawn));
// SetPlayerPos to the random spawn data
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
// SetPlayerFacingAngle to the random facing angle data
SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);}
SetPlayerHealth(playerid,100);
return 1;
}
-
public OnPlayerSpawn(playerid)
{
if(MiniGame[playerid] == 1)
{
if(Tipo[playerid] == 1)
{
new rand = random(sizeof(RandomMini1));
SetPlayerPos(playerid, RandomMini1[rand][0], RandomMini1[rand][1],RandomMini1[rand][2]);
GivePlayerWeapon(playerid, 38, 999999);
}
else if(Tipo[playerid] == 2)
{
new rand = random(sizeof(RandomMini2));
SetPlayerPos(playerid, RandomMini2[rand][0], RandomMini2[rand][1],RandomMini2[rand][2]);
CargarObjetos(playerid);
GivePlayerWeapon(playerid, 38, 999999);
}
else if(Tipo[playerid] == 3)
{
if(Equipo[playerid] == 1)
{
SetPlayerPos(playerid,7714.453125,-2599.890380,24.106107),CargarObjetos(playerid);
GivePlayerWeapon(playerid,29,999999);
GivePlayerWeapon(playerid,30,999999);
GivePlayerWeapon(playerid,31,999999);
new SkinArray[3] = {
285,
287,
280
};
new rand = random(sizeof(SkinArray));
SetPlayerSkin(playerid,SkinArray[rand]);
}
else if(Equipo[playerid] == 2)
{
new SkinArray1[3] = {
28,
29,
30,
};
new rand1 = random(sizeof(SkinArray1));
SetPlayerSkin(playerid,SkinArray1[rand1]);
SetPlayerPos(playerid,7808.556152,-2665.601074,12.653361),CargarObjetos(playerid);
GivePlayerWeapon(playerid,29,999999);
GivePlayerWeapon(playerid,30,999999);
GivePlayerWeapon(playerid,31,999999);
}
}
}
else if(MiniGame[playerid] == 0)
{
SetPlayerPos(playerid, -628.202636,872.717712,1.834375);
SetPlayerFacingAngle(playerid, 90);
SetPlayerHealth(playerid,100);
return 1;
}
-
Sajnos sehogy se akart mûködni :tantrum:
De azért köszi hogy válaszoltál
Zárok