Véletlenszerû háttér a skinválasztónál Helló! Írtam egy kódot ami annyit tesz, hogy a skinválasztóban ha viszed arrébb a skineket akkor nemcsak a skint változtatja hanem a helyét is véletlenszerûen. 20db kameraállást tartalmaz, de ezt te is növelheted csak a new rand = random(20);-ban a 20-hoz annyit adj hozzá amennyit írtál hozzá.
A kód:[pawn]
forward RandomClass(playerid);
public RandomClass(playerid)
{
new rand = random(20);
switch(rand)
{
case 0: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, -296.60, 1644.23, 64.61),
SetPlayerFacingAngle(playerid, 197.40),
SetPlayerCameraPos(playerid, -295.66, 1641.27, 65.67),
SetPlayerCameraLookAt(playerid, -297.81, 1645.78, 63.82);
case 1: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, 2790.61, -2019.36, 13.55),
SetPlayerFacingAngle(playerid, 89.17),
SetPlayerCameraPos(playerid, 2787.34, -2019.09, 14.09),
SetPlayerCameraLookAt(playerid, 2792.31, -2019.64, 14.04);
case 2: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, 304.79, -1869.09, 2.80),
SetPlayerFacingAngle(playerid, 321.45),
SetPlayerCameraPos(playerid, 306.41, -1867.09, 3.79),
SetPlayerCameraLookAt(playerid, 303.26, -1870.97, 2.05);
case 3: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, 416.57, -1369.83, 36.96),
SetPlayerFacingAngle(playerid, 202.62),
SetPlayerCameraPos(playerid, 417.71, -1372.94, 38.26),
SetPlayerCameraLookAt(playerid, 415.95, -1368.26, 37.00);
case 4: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, -2712.73, 223.71, 4.32),
SetPlayerFacingAngle(playerid, 270.30),
SetPlayerCameraPos(playerid, -2709.21, 223.78, 5.83),
SetPlayerCameraLookAt(playerid, -2714.06, 223.75, 4.61);
case 5: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, -1665.05, 1206.80, 13.67),
SetPlayerFacingAngle(playerid, 0.74),
SetPlayerCameraPos(playerid, -1664.91, 1210.50, 15.29),
SetPlayerCameraLookAt(playerid, -1665.02, 1205.50, 13.94);
case 6: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, -211.96, 2660.12, 62.60),
SetPlayerFacingAngle(playerid, 264.98),
SetPlayerCameraPos(playerid, -208.25, 2659.55, 63.01),
SetPlayerCameraLookAt(playerid, -213.20, 2660.21, 63.40);
case 7: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, 2131.49, 1141.79, 13.51),
SetPlayerFacingAngle(playerid, 61.35),
SetPlayerCameraPos(playerid, 2128.19, 1143.39, 14.38),
SetPlayerCameraLookAt(playerid, 2132.68, 1141.19, 13.97);
case 8: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, 2108.25, 1906.46, 10.82),
SetPlayerFacingAngle(playerid, 269.49),
SetPlayerCameraPos(playerid, 2111.25, 1906.15, 11.30),
SetPlayerCameraLookAt(playerid, 2106.27, 1906.59, 11.05);
case 9: SetPlayerInterior(playerid, 0),
SetPlayerPos(playerid, 2115.88, 2409.44, 49.52),
SetPlayerFacingAngle(playerid, 81.96),
SetPlayerCameraPos(playerid, 2112.61, 2410.28, 50.04),
SetPlayerCameraLookAt(playerid, 2117.56, 2409.58, 50.09);
case 10:SetPlayerInterior(playerid, 12),
SetPlayerPos(playerid, 450.20, 510.42, 1001.41),
SetPlayerFacingAngle(playerid, 19.62),
SetPlayerCameraPos(playerid, 449.18, 513.42, 1002.23),
SetPlayerCameraLookAt(playerid, 450.86, 508.71, 1001.17);
case 11:SetPlayerInterior(playerid, 3),
SetPlayerPos(playerid, -105.31, -9.81, 1001.82),
SetPlayerFacingAngle(playerid, 149.97),
SetPlayerCameraPos(playerid, -107.02, -12.98, 1002.68),
SetPlayerCameraLookAt(playerid, -104.90, -8.53, 1001.84);
case 12:SetPlayerInterior(playerid, 1),
SetPlayerPos(playerid, 937.91, 2126.01, 1011.03),
SetPlayerFacingAngle(playerid, 151.42),
SetPlayerCameraPos(playerid, 936.50, 2123.40, 1011.89),
SetPlayerCameraLookAt(playerid, 938.93, 2127.77, 1010.93);
case 13:SetPlayerInterior(playerid, 15),
SetPlayerPos(playerid, 2223.38, -1147.99, 1025.79),
SetPlayerFacingAngle(playerid, 88.31),
SetPlayerCameraPos(playerid, 2219.69, -1148.06, 1026.58),
SetPlayerCameraLookAt(playerid, 2224.69, -1148.08, 1026.04);
case 14:SetPlayerInterior(playerid, 1),
SetPlayerPos(playerid, 449.57, -18.10, 1001.13),
SetPlayerFacingAngle(playerid, 199.04),
SetPlayerCameraPos(playerid, 450.51, -20.83, 1002.28),
SetPlayerCameraLookAt(playerid, 448.98, -16.39, 1000.55);
case 15:SetPlayerInterior(playerid, 1),
SetPlayerPos(playerid, 247.07, 304.01, 999.14),
SetPlayerFacingAngle(playerid, 356.77),
SetPlayerCameraPos(playerid, 247.27, 306.96, 1000.05),
SetPlayerCameraLookAt(playerid, 247.03, 301.96, 998.98);
case 16:SetPlayerInterior(playerid, 2),
SetPlayerPos(playerid, 2449.47, -1703.44, 1013.50),
SetPlayerFacingAngle(playerid, 319.32),
SetPlayerCameraPos(playerid, 2451.65, -1700.90, 1014.49),
SetPlayerCameraLookAt(playerid, 2448.40, -1704.56, 1013.48);
case 17:SetPlayerInterior(playerid, 1),
SetPlayerPos(playerid, 2536.70, -1674.49, 1015.49),
SetPlayerFacingAngle(playerid, 53.78),
SetPlayerCameraPos(playerid, 2533.79, -1672.36, 1016.39),
SetPlayerCameraLookAt(playerid, 2537.71, -1675.34, 1015.49);
case 18:SetPlayerInterior(playerid, 3),
SetPlayerPos(playerid, 960.93, -56.34, 1001.11),
SetPlayerFacingAngle(playerid, 345.99),
SetPlayerCameraPos(playerid, 961.76, -52.61, 1001.87),
SetPlayerCameraLookAt(playerid, 960.57, -57.40, 1001.07);
case 19:SetPlayerInterior(playerid,
,
SetPlayerPos(playerid, 2810.66, -1169.77, 1025.57),
SetPlayerFacingAngle(playerid, 52.61),
SetPlayerCameraPos(playerid, 2807.67, -1167.38, 1026.31),
SetPlayerCameraLookAt(playerid, 2811.56, -1170.52, 1025.95);
}
return 1;
}
[/pawn]
Használata:[pawn]
public OnPlayerRequestClass(playerid, classid)
{
RandomClass(playerid);
return 1;
}
[/pawn]