I dont know if this is something about my script but if I use that code (and J4Rr3x's code) it just shows CJ skin and I cant switch or spawn. Here's my whole code atm.
EDIT: I tried deleting the loop and change it just to AddPlayerClass(); but i still cant spawn.
Код:
#include <a_samp>
main()
{
print("Loading A Second Life gamemode...");
}
stock AddClasses()
{
for(new i = 0; i != 311; i++)
{
switch (i)
{
case 0, 4:
continue;
default:
AddPlayerClass(i, 1544.2551, -1353.2411, 329.4744, 87.6617, 0, 0, 0, 0, 0, 0);
}
}
}
new Float:RandomSpawns[][] =
{
{2201.8760,-1161.0521,25.8780,272.5869}, // Jefferson Motel
{2121.5967,-974.1371,57.7656,171.7050}, // Las Colinas
{2375.6597,-1037.8004,54.1973,172.1514}, // Las Colinas
{2428.9927,-1221.7167,25.4004,179.7292}, // The Pig Pen
{2358.3992,-1365.8174,24.0213,265.7771}, // East Los Santos
{2400.4392,-1548.1301,24.1641,356.5128}, // East Los Santos
{2422.0574,-1498.2944,23.9922,272.9773}, // Cluckin' Bell in East Los Santos
{2236.6924,-1313.7605,23.9844,0.9249}, // Church in Jefferson
{1992.1644,-1282.4811,23.9727,359.3238}, // Glen Park
{1469.8098,-1278.2098,14.5625,87.8510}, // Downtown Los Santos
{1463.2505,-1134.9756,24.0680,222.3933}, // Downtown Los Santos
{1194.1259,-1026.3497,32.4620,176.3744}, // Temple
{1117.3053,-923.9178,43.3906,176.6106}, // Temple
{1193.6819,-891.5307,43.1568,1.7591} // Burger Shot in Mulholland
};
public OnGameModeInit()
{
AddClasses();
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1544.2551, -1353.2411, 329.4744);
SetPlayerFacingAngle(playerid, 87.6617);
SetPlayerCameraPos(playerid, 1537.2468, -1352.9548, 329.4599);
SetPlayerCameraLookAt(playerid, 1544.2551, -1353.2411, 329.4744);
}
public OnPlayerSpawn(playerid)
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
return 1;
}