[Ajuda] Checar Online/Offline Lнder
#1

Alguem sabe como coloco pra checar se o Lнder da ORG Estб Online ou Offline ? pfv

Код:
	CMD:orgs(playerid)
	{
        new string[MAX_STRING];
		gs_Buffer[0] = EOS;
        format(string,sizeof(string), "{1E90FF}Governamental\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{0099ff}7 - %s:{FFFFFF} %s\n", GetOrgName(7), InfoOrg[7][Lider]);//governo
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{00660C}3 - %s:{FFFFFF} %s\n", GetOrgName(3), InfoOrg[3][Lider]);//Guarda Nacional
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{917662}11 - %s:{FFFFFF} %s\n", GetOrgName(11), InfoOrg[11][Lider]);//pf
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{906000}33 - %s:{FFFFFF} %s\n", GetOrgName(33), InfoOrg[33][Lider]);//pc
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{FF6200}34 - %s:{FFFFFF} %s\n", GetOrgName(34), InfoOrg[34][Lider]);//pc
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{9fa4e8}1 - %s:{FFFFFF} %s\n", GetOrgName(1), InfoOrg[1][Lider]);//pm
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{3e3d3d}2 - %s:{FFFFFF} %s\n", GetOrgName(2), InfoOrg[2][Lider]);//rota
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{408080}16 - %s:{FFFFFF} %s\n\n", GetOrgName(16), InfoOrg[16][Lider]);//bope
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{1E90FF}Gangsters\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{337EFF}5 - %s:{FFFFFF} %s\n", GetOrgName(5), InfoOrg[5][Lider]);//aztecas
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{00da1c}14 - %s:{FFFFFF} %s\n", GetOrgName(14), InfoOrg[14][Lider]);//grove
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{c640dd}17 - %s:{FFFFFF} %s\n", GetOrgName(17), InfoOrg[17][Lider]);//ballas
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{DEBC00}18 - %s:{FFFFFF} %s\n", GetOrgName(18), InfoOrg[18][Lider]);//losvagos
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{FF3636}19 - %s:{FFFFFF} %s\n", GetOrgName(19), InfoOrg[19][Lider]);//cv
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{9ACD32}21 - %s:{FFFFFF} %s\n\n", GetOrgName(21), InfoOrg[21][Lider]);//pcc
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{1E90FF}Assassinas\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{BDBDBD}8 - %s:{FFFFFF} %s\n", GetOrgName(8), InfoOrg[8][Lider]);//hitmans
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{A4D1FF}22 - %s:{FFFFFF} %s\n\n", GetOrgName(22), InfoOrg[22][Lider]);//triads
		strcat(gs_Buffer,string);//
		format(string,sizeof(string), "{1E90FF}Mafiosas\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{D48A30}12 - %s:{FFFFFF} %s\n", GetOrgName(12), InfoOrg[12][Lider]);//cosa
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{00483A}13 - %s:{FFFFFF} %s\n\n", GetOrgName(13), InfoOrg[13][Lider]);//yakuza
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{1E90FF}Terroristas\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{6E6E6E}15 - %s:{FFFFFF} %s\n", GetOrgName(15), InfoOrg[15][Lider]);//asfarc
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{CC0196}23 - %s:{FFFFFF} %s\n\n", GetOrgName(23), InfoOrg[23][Lider]);//gi
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{1E90FF}Mercenбrias\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{961e32}24 - %s:{FFFFFF} %s\n", GetOrgName(24), InfoOrg[24][Lider]);//HellsAngels
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{535d71}25 - %s:{FFFFFF} %s\n\n", GetOrgName(25), InfoOrg[25][Lider]);//sons
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{1E90FF}Particular\n\n");
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{ffe99e}9 - %s:{FFFFFF} %s\n", GetOrgName(9), InfoOrg[9][Lider]);//reporteres
		strcat(gs_Buffer,string);
		format(string,sizeof(string), "{F78181}4 - %s:{FFFFFF} %s\n\n", GetOrgName(4), InfoOrg[4][Lider]);//pc
		strcat(gs_Buffer,string);
		ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{A0A0A0}Lнderes das Organizaзхes", gs_Buffer, "Fechar","");
		return true;
		//return ShowPlayerDialog(playerid, 8724, DIALOG_STYLE_TABLIST_HEADERS, "Lнderes das Organizaзхes", gs_Buffer, "Fechar", "");
	}
Reply
#2

PHP код:
player_IsConnected(playername[]) {
    static 
string[25], i;
    for(
GetMaxPlayers() - 1> -1; --i) {
        if(
IsPlayerConnected(i)) {
            
GetPlayerName(istringsizeof string);
            if(!
strcmp(playernamestringfalse)) {
                return 
true;
            }
        }
    }
    return 
false;
}

if(
player_IsConnected(InfoOrg[9][Lider])) {
    
//online
}
else {
    
//ofline

Reply
#3

Quote:
Originally Posted by ipsLuan
Посмотреть сообщение
PHP код:
player_IsConnected(playername[]) {
    static 
string[25], i;
    for(
GetMaxPlayers() - 1> -1; --i) {
        if(
IsPlayerConnected(i)) {
            
GetPlayerName(istringsizeof string);
            if(!
strcmp(playernamestringfalse)) {
                return 
true;
            }
        }
    }
    return 
false;
}
if(
player_IsConnected(InfoOrg[9][Lider])) {
    
//online
}
else {
    
//ofline

Nгo Expliquei muito bem, mas tipo o que eu tava tentando falar й que Tipo Ao Lado do Nome do Lider uma Mensagem dizendo se ele estб "Online ou Onffline"
Reply
#4

Aн vocк precisa fazer a verificaзгo com operaзгo ternбria.

PHP код:
if(player_IsConnected(InfoOrg[9][Lider])) : online offline 
Reply
#5

Utilize o parametro U do sscanf, й a maneira mais otimizada de fazer isso, e mais simples tambem!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)