"Fulano Nнvel 1/5 Online
"Fulano2 Nivйl 1/5 Online"
Fulano Nнvel 1/5 Online
Fulano2 Nнvel 1/5 Online
dcmd_admins(playerid,params[]) {
#pragma unused params
//Alertar admins para quem digitar o comando /admins
if(PlayerInfo[playerid][Level] < 1){
new pname[MAX_PLAYER_NAME],SACSB[100];GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(SACSB, sizeof(SACSB), "| CMDS-LOG | O(A) jogador(a) %s[%d] usou o comando ( /Admins )", pname, playerid);
CallRemoteFunction("MessageToAdmins","is",yellow,SACSB);}
//Estrutura do comando /admins
new Adms[650],ADMsDialog[810],ADMsDialog2[810],Name[MAX_PLAYER_NAME],level,admscount;
for(new i,a = GetMaxPlayers();i < a;i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Level] > 0)
{
if(AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
{
level = PlayerInfo[i][Level];
GetPlayerName(i, Name, sizeof(Name));
if(admscount < 15) format(Adms, sizeof(Adms), "%s[%i] \t%i/5 \tOnline\n%s",Name,i,level,Adms);
admscount++;
}
}
}
}
if(admscount > 0)
format(ADMsDialog, sizeof(ADMsDialog), "%s",Adms);
else
format(ADMsDialog2, sizeof(ADMsDialog2), "{FF0000}Nгo hб administradores online no momento!", admscount,Adms);
ShowPlayerDialog(playerid,1000,DIALOG_STYLE_LIST,"Admins",ADMsDialog,"Fechar","");
ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins",ADMsDialog2,"Fechar","");
return 1;}
stock FixAdminList(adm_name[], adm_level, bool:adm_online, fixed_string[]) { // formato: // nome do admin (24 char) nнvel x/x on/offline // aaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbb ccccccc new len_adm_name = strlen(adm_name); new calc_spaces = MAX_PLAYER_NAME - len_adm_name; fixed_string[0] = '\0'; strcat(fixed_string, adm_name, 43); for(new x = 0; x < calc_spaces; ++ x) strcat(fixed_string, " ", 43); format(fixed_string, 43, "%s Nivel %d/5 %s", fixed_string, adm_level, (adm_online ? ("Online") : ("Offline"))); return 1; }
new str[43]; // String que receberб a linha fixada FixAdminList("Fulano", 1, true, str); print(str); // Output de teste FixAdminList("Fulano2", 3, false, str); print(str); // Output de teste
Fulano Nivel 1/5 Online Fulano2 Nivel 3/5 Offline
Funзгo:
Код:
stock FixAdminList(adm_name[], adm_level, bool:adm_online, fixed_string[]) { // formato: // nome do admin (24 char) nнvel x/x on/offline // aaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbb ccccccc new len_adm_name = strlen(adm_name); new calc_spaces = MAX_PLAYER_NAME - len_adm_name; fixed_string[0] = '\0'; strcat(fixed_string, adm_name, 43); for(new x = 0; x < calc_spaces; ++ x) strcat(fixed_string, " ", 43); format(fixed_string, 43, "%s Nivel %d/5 %s", fixed_string, adm_level, (adm_online ? ("Online") : ("Offline"))); return 1; } Код:
new str[43]; // String que receberб a linha fixada FixAdminList("Fulano", 1, true, str); print(str); // Output de teste FixAdminList("Fulano2", 3, false, str); print(str); // Output de teste Код:
Fulano Nivel 1/5 Online Fulano2 Nivel 3/5 Offline |
dcmd_admins(playerid,params[]) { #pragma unused params //Alertar admins para quem digitar o comando /admins if(PlayerInfo[playerid][Level] < 1) { new pname[MAX_PLAYER_NAME],SACSB[100];GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(SACSB, sizeof(SACSB), "| CMDS-LOG | O(A) jogador(a) %s[%d] usou o comando ( /Admins )", pname, playerid); CallRemoteFunction("MessageToAdmins","is",yellow,SACSB); } //Estrutura do comando /admins new Fixed[43], ADMsDialog[43*15], Name[MAX_PLAYER_NAME], level, admscount; for(new i, a = GetPlayerPoolSize(); i <= a; i++) { if(IsPlayerConnected(i)) { level = PlayerInfo[i][Level]; if(level > 0) { if(AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0) { GetPlayerName(i, Name, sizeof(Name)); FixAdminList(Name, 1, true, Fixed); strcat(ADMsDialog, Fixed); admscount++; } } } } if(admscount > 0) ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins", ADMsDialog, "Fechar", ""); else ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins", "{FF0000}Nгo hб administradores online no momento!", "Fechar", ""); return 1; }
stock FixAdminList(adm_name[], adm_level, bool:adm_online, fixed_string[]) { // formato: // nome do admin (24 char) nнvel x/x on/offline // aaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbb ccccccc new len_adm_name = strlen(adm_name); new calc_spaces = MAX_PLAYER_NAME - len_adm_name; fixed_string[0] = '\0'; strcat(fixed_string, adm_name, 43); for(new x = 0; x < calc_spaces; ++ x) strcat(fixed_string, " ", 43); format(fixed_string, 43, "%s Nivel %d/5 %s\n", fixed_string, adm_level, (adm_online ? ("Online") : ("Offline"))); return 1; }
Fiz uma adaptaзгo na funзгo para que ela possa ser utilizada diretamente em uma caixa de diбlogo:
Comando: Код:
dcmd_admins(playerid,params[]) { #pragma unused params //Alertar admins para quem digitar o comando /admins if(PlayerInfo[playerid][Level] < 1) { new pname[MAX_PLAYER_NAME],SACSB[100];GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(SACSB, sizeof(SACSB), "| CMDS-LOG | O(A) jogador(a) %s[%d] usou o comando ( /Admins )", pname, playerid); CallRemoteFunction("MessageToAdmins","is",yellow,SACSB); } //Estrutura do comando /admins new Fixed[43], ADMsDialog[43*15], Name[MAX_PLAYER_NAME], level, admscount; for(new i, a = GetPlayerPoolSize(); i <= a; i++) { if(IsPlayerConnected(i)) { level = PlayerInfo[i][Level]; if(level > 0) { if(AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0) { GetPlayerName(i, Name, sizeof(Name)); FixAdminList(Name, 1, true, Fixed); strcat(ADMsDialog, Fixed); admscount++; } } } } if(admscount > 0) ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins", ADMsDialog, "Fechar", ""); else ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins", "{FF0000}Nгo hб administradores online no momento!", "Fechar", ""); return 1; } Код:
stock FixAdminList(adm_name[], adm_level, bool:adm_online, fixed_string[]) { // formato: // nome do admin (24 char) nнvel x/x on/offline // aaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbb ccccccc new len_adm_name = strlen(adm_name); new calc_spaces = MAX_PLAYER_NAME - len_adm_name; fixed_string[0] = '\0'; strcat(fixed_string, adm_name, 43); for(new x = 0; x < calc_spaces; ++ x) strcat(fixed_string, " ", 43); format(fixed_string, 43, "%s Nivel %d/5 %s\n", fixed_string, adm_level, (adm_online ? ("Online") : ("Offline"))); return 1; } |
C:\Users\Pedro Tramontina\Desktop\Projeto\filterscripts\ladmin4v2.pwn(4797) : error 017: undefined symbol "GetPlayerPoolSize"
for(new i, a = GetPlayerPoolSize(); i <= a; i++)
vlw man,mais deu esse erro aq "
PHP код:
Linha do erro PHP код:
|