11.12.2017, 16:49
Quote:
Checando em qual favela estб;
PHP код:
PHP код:
ex: stock dominandofavela1() tu ja seta o id 1; Mas em array ficar mais organizado e menor PHP код:
|
Код:
enum t_info { tNome[64], Sigla[6], Estado, Float:Spawn[3], tCor, tSkin, } #define MAX_FACCOES 5 // new Faccoes[MAX_FACCOES][t_info] = { {"Faccao", "Sigla", 0, {0.0, 0.0, 0.0}, COR_FVL, 0}, {"Favela1", "1", 9, {2430.4404,-834.8191,108.6482}, COR_FVL, 0},// {"Favela2", "2", 9, {1048.6327,2908.5356,49.0728}, COR_FVL, 0},// {"Favela3", "3", 9, {-383.8202,-109.6752,51.3575}, COR_FVL, 0},// {"Favela4", "4", 9, {1172.0436,-2004.6012,70.2221}, COR_FVL, 0},// };
Код:
for(new i=0;i<MAX_GZS;i++) { if(GetPlayerVisibleDynamicCP(playerid) == ChecksDominio[i]) { if(Player[playerid][pAdmin] >= 1) { if(ContagemDominio[i] != 0) return 1; if((strcmp(GZDono[i], "{8B0000}FAC1", true) == 0) && Player[playerid][pFaccao] == 1 || (strcmp(GZDono[i], "{8B0000}FAC1", true) == 0) && Player[playerid][pFaccao] == 2 || (strcmp(GZDono[i], "{8B0000}FAC1", true) == 0) && Player[playerid][pFaccao] == 3 || (strcmp(GZDono[i], "{8B0000}FAC1", true) == 0) && Player[playerid][pFaccao] == 4 || return SendClientMessage(playerid, COR_ERRO, "ERRO: Esta favela jб estб dominada!"); SetPVarInt(playerid,"GZAtacada",i); ContagemDominio[i] = SetTimerEx("Contagem",1000,1,"i",playerid); GangZoneFlashForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")],GetPlayerColor(playerid)); CP[playerid] = 4;