[AJUDA] /guardioes
#1

Ajuda aqui galera, tipo tava tentando criar um comando dnv para verificar os players que sгo guardiao online no servidor, uso esses para verificar se o player й guardiao ou nгo:

PHP код:
Guardiao[playerid] = 1
ou
PHP код:
if(dini_Int(conta"Guardiao") == 1
Mais nгo to conseguindo , jб tinha aberto um outro tуpico pedindo isso, sу que nenhuma resposta fui ъtil e agora troquei meu gm ;s

Ajuda ai galera pf ;s
Reply
#2

pawn Код:
if(strcmp("/guardioes", cmdtext, true) == 0)
{
 if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "[!] Vocк nгo estб conectado!");
 SendClientMessage(playerid, -1, "Guardiхes Online:");
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
  if(!IsPlayerConnected(i)) return SendClientMessage(playerid, -1, "[!] No momento nгo hб guardiхes online!");
  if(Guardioes[playerid] >= 1)
  {
   new string[15];
   new Nome[MAX_PLAYER_NAME];
   GetPlayerName(i, Nome, sizeofNome));
   format(string, 15, "Guardiгo: %s", Nome);
   SendClientMessage(playerid, -1, string);
  }        
 }
 return 1;
}
Reply
#3

Shick, seu comando estб completamente errado
PHP код:
if(!strcmp("/guardioes"cmdtexttrue)) {
    
SendClientMessage(playerid, -1"Guardiхes Online:");
    for(new 
0MAX_PLAYERS; ++i) {
        if(
Guardioes[i] > 0) {
            new 
string[0x3C];
            new 
Nome[MAX_PLAYER_NAME]; GetPlayerName(iNomesizeof(Nome) );
            
format(stringsizeof(string), "Guardiгo: %s"Nome);
            
SendClientMessage(playerid, -1string);
        }
    }
    return 
1;

Reply
#4

PHP код:
if(!strcmp("/guardioes"cmdtexttrue))
{
    new 
count 0;
    
SendClientMessage(playerid, -1"Guardiхes Online:");
    for(new 
0MAX_PLAYERS; ++i) {
        if(
Guardioes[i] > 0) {
            new 
string[0x3C],Nome[MAX_PLAYER_NAME];
            
GetPlayerName(iNomesizeof(Nome) );
            
format(stringsizeof(string), "Guardiгo: %s"Nome);
            
SendClientMessage(playerid, -1string);
            
count++;
        }
    }
    if(
count == 0) return SendClientMessage(playerid, -1"Nenhum guardiгo online");
    return 
true;

...
Reply
#5

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
Shick, seu comando estб completamente errado
PHP код:
if(!strcmp("/guardioes"cmdtexttrue)) {
    
SendClientMessage(playerid, -1"Guardiхes Online:");
    for(new 
0MAX_PLAYERS; ++i) {
        if(
Guardioes[i] > 0) {
            new 
string[0x3C];
            new 
Nome[MAX_PLAYER_NAME]; GetPlayerName(iNomesizeof(Nome) );
            
format(stringsizeof(string), "Guardiгo: %s"Nome);
            
SendClientMessage(playerid, -1string);
        }
    }
    return 
1;

Ricop
PHP код:
 if(Guardioes[i] > 0) { 
deu certo, so que quando o id ' 0 ' entra no server, e sai, e depois volta, ele entra automaticamente no /guardioes ;s , ele nгo vira guardiгo , apenas entra no /guardioes, ajuda?
PHP код:
Uso isso para definir o guardiao do player:
Guardiao[playerid] = <~ Й Guardiao
Guardiao
[playerid] = <~ Nгo й Guardiao
dini_Int
(conta"Guardiao") == 1
Entendi a lуgica ali:
Guardioes[i] > 0, iria verificar todos os players definidos como guardiao acima do valor ' 0 ' como estб em cima: Guardiao[playerid] = 1, mais o player como falei com o id 0 ele entra automaticamente no /guardioes ;s
Reply
#6

PHP код:
if(!strcmp("/guardioes"cmdtexttrue)) { 
    
SendClientMessage(playerid, -1"Guardiхes Online:"); 
    for(new 
0MAX_PLAYERS; ++i) { 
        if(
Guardioes[i] == 1) { 
            new 
string[0x3C]; 
            new 
Nome[MAX_PLAYER_NAME]; GetPlayerName(iNomesizeof(Nome) ); 
            
format(stringsizeof(string), "Guardiгo: %s"Nome); 
            
SendClientMessage(playerid, -1string); 
        } 
    } 
    return 
1

Veja se vai.
Reply
#7

Quote:
Originally Posted by Rodrigo.
Посмотреть сообщение
Ricop
[php]
Entendi a lуgica ali:
Guardioes[i] > 0, iria verificar todos os players definidos como guardiao acima do valor ' 0 ' como estб em cima: Guardiao[playerid] = 1, mais o player como falei com o id 0 ele entra automaticamente no /guardioes ;s
coloca no OnPlayerDisconnect,

Guardiao[playerid] = 0;

dai quando o cara sair, ele automaticamente perde o titulo de guardiгo..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)