04.10.2015, 14:21
OK, so this is all of my code I've currently got.
Random Spawns:
Team/Gang Defines:
Team/Gang OnPlayerConnect:
Stocks for the Team/Gangs:
The reason I'm having problems is because when you join/spawn in; it still spawns you in the default location, even though my random spawns are set; also it doesn't change the color like it's supposed to.
Random Spawns:
Код:
stock Float:NaNangBoysSpawn[][4] = { {-1983.503417,125.564216,27.687500,86.831398}, {-1984.343017,173.488876,27.687500,88.084724}, {-1983.458374,109.709213,27.679862,88.711402}, {-1972.408935,123.415649,27.687500,94.351356} }; stock Float:SanFierroRifaSpawn[][4] = { {-2016.646240,743.256835,45.445312,179.916061}, {-2053.552001,743.580871,59.456466,183.048904}, {-2072.767578,742.477539,67.443588,181.168869}, {-2090.511962,742.674621,69.562500,176.132171} }; stock Float:TriadSpawn[][4] = { {-2617.268798,887.188415,62.963428,266.059631}, {-2629.722900,925.391967,70.294868,201.199066}, {-2613.927490,928.889221,66.955726,268.253051}, {-2596.608642,914.707092,64.975585,100.304786} }; stock Float:BikerSpawn[][4] = { {-2653.468261,1343.483886,7.144225,265.143157}, {-2645.370849,1325.767700,7.158458,314.963653}, {-2668.159667,1387.409301,7.101562,282.086761}, {-2670.589111,1374.913452,7.118103,256.393218} }; stock Float:TheRussianMafiaSpawn[][4] = { {-1498.902832,1006.203918,7.187500,144.868881}, {-1517.512084,1015.012817,7.187500,137.348815}, {-1507.831909,1034.389892,7.184553,175.865722}, {-1517.282958,1048.561645,7.187500,178.059112} }; stock Float:ArmySpawn[][4] = { {-1547.064697,404.753906,7.187500,33.657802}, {-1570.932128,363.076599,7.187500,67.498115}, {-1613.230590,343.793609,7.187500,105.411781}, {-1603.929077,310.714508,7.187500,229.179656} };
Код:
#define TEAM_NANANG 1 #define TEAM_FIERRO 2 #define TEAM_TRIAD 3 #define TEAM_BIKER 4 #define TEAM_MAFIA 5 #define TEAM_ARMY 6
Код:
if(classid >= 0 && classid <= 2) { GameTextForPlayer(playerid, "~g~~h~NaNang Boys", 1000, 4); SetPlayerPos(playerid, 2498.222900, -1644.685791, 18.877799); SetPlayerFacingAngle(playerid, 179.865814); SetPlayerCameraLookAt(playerid, 2498.222900, -1644.685791, 18.877799); SetPlayerCameraPos(playerid, 2498.222900 + (10 * floatsin(-179.865814, degrees)), -1644.685791 + (10 * floatcos(-179.865814, degrees)), 18.877799); } r
Код:
stock SetPlayerTeamFromClass(playerid, classid) { if(classid >= 0 && classid <= 2) [gTeam][playerid] = TEAM_NANANG; else if(classid >= 3 && classid <= 5) [gTeam][playerid] = TEAM_FIERRO; else if(classid >= 6 && classid <= 8) [gTeam][playerid] = TEAM_TRIAD; else if(classid >= 9 && classid <= 11) [gTeam][playerid] = TEAM_BIKER; else if(classid >= 12 && classid <= 14) [gTeam][playerid] = TEAM_MAFIA; else if(classid >= 14 && classid <= 17) [gTeam][playerid] = TEAM_ARMY; } stock SetPlayerToTeamColour(playerid) { if([gTeam][playerid] == TEAM_NANANG) { SetPlayerColor(playerid, NANANG_COLOR); } if([gTeam][playerid] == TEAM_FIERRO) { SetPlayerColor(playerid, FIERRO_COLOR); } if([gTeam][playerid] == TEAM_TRIAD) { SetPlayerColor(playerid, TRIAD_COLOR); } if([gTeam][playerid] == TEAM_BIKER) { SetPlayerColor(playerid, BIKER_COLOR); } if([gTeam][playerid] == TEAM_MAFIA) { SetPlayerColor(playerid, MAFIA_COLOR); } if([gTeam][playerid] == TEAM_ARMY) { SetPlayerColor(playerid, ARMY_COLOR); } return 1; }