25.03.2015, 03:06
Aqui estб tudo certo mas na hora de criar os Gangs no servidor quando um lider da gang muda a cor do seu tal Gang, a cor que ele escolheu fica para todos os players que estгo no servidor. Alguйm sabe o que pode ser?
COMANDO: CMD:gcolor(playerid) { if(PlayerInfo[playerid][IsLider] == 0) return SendClientMessage(playerid, Vermelho, "You is not no gang leader."); ShowPlayerDialog(playerid, D_GangColor, DIALOG_STYLE_LIST, "Choose a color:", "{FF0000}Red\n{00FF00}Green\n{FFFF00}Yellow\n{0000FF}Blue\n{FF8000}Orange\n{9F009F}Purple\n{80FFFF}Navy Blue\n{FF80FF}Rose\n{C0C0C0}Gray\n{804000}Marrom\n{FFFFFF}Green Olive\n{80BFFF}Light Blue\n{007138}Dark Green\n{B69DEB}Light Purple", "Ok", "Cancel"); return 1; } Parte mysql: //Gangs system if(dialogid == D_GangColor) { if(response) { if(listitem == 0) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xFF0000AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xFF0000AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xFF0000AA); } } if(listitem == 1) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x00FF00AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x00FF00AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x00FF00AA); } } if(listitem == 2) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xFFFF00AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xFFFF00AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xFFFF00AA); } } if(listitem == 3) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x0000FFAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x0000FFAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x0000FFAA); } } if(listitem == 4) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xFF8000AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xFF8000AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xFF8000AA); } } if(listitem == 5) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x9F009FAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x9F009FAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x9F009FAA); } } if(listitem == 6) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x80FFFFAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x80FFFFAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x80FFFFAA); } } if(listitem == 7) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xFF80FFAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xFF80FFAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xFF80FFAA); } } if(listitem == 8) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xC0C0C0AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xC0C0C0AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xC0C0C0AA); } } if(listitem == 9) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x804000AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x804000AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x804000AA); } } if(listitem == 10) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xFFFFFFAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xFFFFFFAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xFFFFFFAA); } } if(listitem == 11) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x80BFFFAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x80BFFFAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x80BFFFAA); } } if(listitem == 12) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0x007138AA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0x007138AA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0x007138AA); } } if(listitem == 13) { new idg = PlayerInfo[playerid][idgang]; new string[256]; format(string,sizeof(string),"UPDATE gangs SET Cor = '0xB69DEBAA' WHERE Lider = '%s'",nome(playerid)); mysql_query(mysql, string); PlayerPlaySound(playerid, 10, 0.0, 0.0, 0.0); SetPlayerColor(playerid, 0xB69DEBAA); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][idgang] == idg) { SetPlayerColor(i, 0xB69DEBAA); } } } }