27.05.2012, 07:53
Hi guys, I am trying to convert a script of gangwars. My old one didn't use gTeam, but I have worked on gTeam today, and it isn't going well.
The compiler isn't giving any errors, but when I go in game and spawn, my color isn't set, and I highly doubt my team is either.
I tried the color at class selection [http://i.imgur.com/Z53UH.png]
Then when I spawn, my color doesn't change. [http://i.imgur.com/uXgE6.png]
Have I done anything wrong? If someone can help me, then I will give rep.#
Thanks ^^
The compiler isn't giving any errors, but when I go in game and spawn, my color isn't set, and I highly doubt my team is either.
I tried the color at class selection [http://i.imgur.com/Z53UH.png]
Then when I spawn, my color doesn't change. [http://i.imgur.com/uXgE6.png]
Код:
#include <a_samp> //Gang Colors #define COLOR_HOBO 0x393939C8 #define COLOR_GROVE 0x1F7B04C8 #define COLOR_BALLAS 0x890398C8 #define COLOR_VAGOS 0xE1F20DC8 #define COLOR_AZTECAS 0x00FFFFC8 #define COLOR_COPS 0x0080FFC8 #define COLOR_MAFIA 0x183298C8 #define COLOR_MEDICS 0xFF0080C8 //Gangs new gTeam [MAX_PLAYERS]; #define hobos 1 #define grove 2 #define ballas 3 #define vagos 4 #define aztecas 5 #define cops 6 #define mafia 7 #define medics 8 forward SetPlayerToTeamColour(playerid); forward SetPlayerTeamFromClass(playerid,classid); //----------------------------------------------------------- //----------------------------------------------------------- public SetPlayerTeamFromClass(playerid, classid) { if(classid == 0 || classid == 1) { gTeam[playerid] = hobos; //this } else if(classid == 2 || classid == 3) { gTeam[playerid] = grove; //this } else if(classid == 4 || classid == 5) { gTeam[playerid] = ballas; } else if(classid == 6 || classid == 7) { gTeam[playerid] = vagos; } else if(classid == 8 || classid == 9) { gTeam[playerid] = aztecas; } else if(classid == 10 || classid == 11) { gTeam[playerid] = cops; } else if(classid == 12 || classid == 13) { gTeam[playerid] = mafia; } else if(classid == 14 || classid == 15) { gTeam[playerid] = medics; } } public SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == hobos) { SetPlayerColor(playerid, COLOR_HOBO); } else if(gTeam[playerid] == grove) { SetPlayerColor(playerid, COLOR_GROVE); } else if(gTeam[playerid] == ballas) { SetPlayerColor(playerid, COLOR_BALLAS); } else if(gTeam[playerid] == vagos) { SetPlayerColor(playerid, COLOR_VAGOS); } else if(gTeam[playerid] == aztecas) { SetPlayerColor(playerid, COLOR_AZTECAS); } else if(gTeam[playerid] == cops) { SetPlayerColor(playerid, COLOR_COPS); } else if(gTeam[playerid] == mafia) { SetPlayerColor(playerid, COLOR_MAFIA); } else if(gTeam[playerid] == medics) { SetPlayerColor(playerid, COLOR_MEDICS); } } public OnGameModeInit() { //Anims UsePlayerPedAnims(); //GameModeText and Worldtime SetGameModeText("Gangwars/DM"); SetWorldTime(7); //Classes //Team Hobo AddPlayerClass(137,1973.4954,-1560.3402,13.6389,224.7649,24,100,25,100,4,1); // skin 1 pos AddPlayerClass(230,1958.7997,-1561.2727,13.5960,222.2816,24,100,31,250,8,1); // skin 2 pos //Team Grove AddPlayerClass(106,2523.0234,-1658.9280,15.4935,88.0275,4,1,25,75,31,200); // grove skin 1 pos AddPlayerClass(107,2512.9238,-1650.7551,14.0938,135.6546,9,1,24,90,32,250); // grove skin 2 spawn pos //Team Balla AddPlayerClass(102,1909.8513,-1115.7181,25.6641,178.5448,4,1,25,70,31,200); // balla spawn pos skin 1 102 AddPlayerClass(104,1939.1782,-1117.4927,26.4455,178.7132,2,1,27,100,23,75); // balla spawn pos skin 2 104 //Team Vagos AddPlayerClass(110,2624.0303,-1202.7760,61.0703,268.6752,5,1,24,100,25,80); // vagos 1 positiion skin 110 AddPlayerClass(109,2626.9021,-1202.0135,62.5425,179.3977,2,1,25,100,29,200); // vagos 2 position skin 109 //Team Aztecas AddPlayerClass(115,1667.4141,-2108.7278,13.7296,182.4924,8,1,24,125,29,200); // azteca spawn position 115 AddPlayerClass(116,1674.8219,-2121.9463,13.9760,314.7127,4,1,26,85,23,75); // skin 116 azteca //Team Cops AddPlayerClass(284,1549.3387,-1680.1816,13.5568,91.5889,3,1,24,75,30,200); // cop skin 1 284 AddPlayerClass(280,1547.3654,-1671.3651,13.5684,88.2312,4,1,24,90,27,100); // cop skin 2 280 //Team Mafia AddPlayerClass(124,812.3387,-1100.6776,25.7861,269.7575,24,90,33,70,25,100); // mafia skin 1 124 AddPlayerClass(125,810.9052,-1093.8740,25.7844,181.6866,9,1,24,90,31,300); // mafia skin 2 125 //Team Medics AddPlayerClass(193,1180.8661,-1324.2241,13.5864,274.7145,24,90,27,100,34,75); // medic skin 193 AddPlayerClass(274,1173.4956,-1322.9530,15.1953,268.1345,9,1,28,250,25,90); // skin 274 medic skin 2
Thanks ^^