[Ajuda] Comando /inforconta.
#1

Auguйm pode me dar uma ajudinha nisto, o comando so diz somente que o player estб online...
acho que tem haver com isso: IsPlayerConnected(playerid), como devo proceder?


PHP код:
command(inforcontaplayeridparams[])
{
    if (
APlayerData[playerid][PlayerLevel] >= 1)
    {
    if(
isnull(params)) {
        return 
SendClientMessage(playerid, -1"/inforconta ( Nome Da Conta )");
    }
    new 
filename[MAX_PLAYER_NAME+18];
    
format(filenamesizeof(filename), "/ServerData/Players/%s.ini"params);
    if(!
fexist(filename)) {
        return 
SendClientMessage(playerid, -1"ERRO: A conta nгo foi encontrada na pasta players.");
    }
    new
        
File:file fopen(filenameio_read),
        
Cells1[74],
        
Cells[74],
        
Cells2[74],
        
Cells3[74],
        
Name[20],
        
Value[20],
        
Value2[20],
        
cash,
        
admin,
        
banned,
        
bannedresult[500],
        
Adminrank[500];
    while(
fread(fileCells)) {
        if(!
sscanf(Cells"p<=>s[20]s[20]"NameValue,Value2)) {
            if(!
strcmp(Name"Cash ")) {
                
cash strval(Value);
                break;
            }
            else if(!
strcmp(Name"Admin ")) {
                
admin strval(Value2);
                break;
            }
        }
    }
    switch(
banned)
    {
      case 
0bannedresult "Sim";
      case 
1bannedresult "Nгo";
     }
    switch(
admin)
    {
      case 
0Adminrank "Nгo faz parte da STAFF";
      case 
1Adminrank "Ajudante";
      case 
2Adminrank "Moderator";
      case 
3Adminrank "Administrator";
      case 
4Adminrank "Sub Dono";
      case 
5Adminrank "Game Master";
     }
    
format(Cells1sizeof(Cells1), "Status: ( %s )\n"IsPlayerConnected(playerid) ? ("Online") : ("Offline"));
    
format(Cellssizeof(Cells), "Dinheiro: %d",cash);
    
format(Cells3sizeof(Cells3), "Administrador: %s",Adminrank);
    
format(Cells2sizeof(Cells2), "==> %s's Status"params);
    
SendClientMessage(playerid, -1Cells1);
    
SendClientMessage(playerid, -1Cells2);
    
SendClientMessage(playerid, -1Cells);
    
SendClientMessage(playerid, -1Cells3);
    return 
true;
    }
    else
    {
        
SendClientMessage(playerid,-1,"ERRO: Voce nгo pode ter acesso a este comando!");
        return 
1;
    }

Reply
#2

Cara tem uma pб de erros nisso aн..
Estou pelo notbook quando entrar no pc irei ajudar.
Reply
#3

ok amigo, desde jб agradeзo
Reply
#4

Auguem?
Reply
#5

PHP код:
command(inforcontaplayeridparams[])
{
    if (
APlayerData[playerid][PlayerLevel] >= 1)
    {
    if(
isnull(params)) {
        return 
SendClientMessage(playerid, -1"/inforconta ( Nome Da Conta )");
    }

    new 
filename[MAX_PLAYER_NAME+18];
    
format(filenamesizeof(filename), "/ServerData/Players/%s.ini"params);

    if(!
fexist(filename)) {
        return 
SendClientMessage(playerid, -1"ERRO: A conta nгo foi encontrada na pasta players.");
    }

    new
        
File:file fopen(filenameio_read),
        
Cells1[74],
        
Cells[74],
        
Cells2[74],
        
Cells3[74],
        
Name[20],
        
Value[20],
        
Value2[20],
        
cash,
        
admin,
        
banned,
        
bannedresult[500],
        
Adminrank[500],
        
conectado,
        
nome2[74];

    while(
fread(fileCells)) {
        if(!
sscanf(Cells"p<=>s[20]s[20]"NameValue,Value2)) {
            if(!
strcmp(Name"Cash ")) {
                
cash strval(Value);
                break;
            }
            else if(!
strcmp(Name"Admin ")) {
                
admin strval(Value2);
                break;
            }
        }
    }
    switch(
banned)
    {
      case 
0bannedresult "Sim";
      case 
1bannedresult "Nгo";
     }
    switch(
admin)
    {
      case 
0Adminrank "Nгo faz parte da STAFF";
      case 
1Adminrank "Ajudante";
      case 
2Adminrank "Moderator";
      case 
3Adminrank "Administrator";
      case 
4Adminrank "Sub Dono";
      case 
5Adminrank "Game Master";
     }
    
conectado 0;
    
    for(new 
0MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i)) continue;
        
        
GetPlayerName(inome2sizeof(nome2));
        
        if(
strcmp(nome2paramstrue) == 1) continue;
        
        
conectado 1;
        
        break;
    } 
    if(
conectado == 1)
    {
        
format(Cells1sizeof(Cells1), "Status: ( Online )\n");
    }
    if(
conectado == 0)
    {
        
format(Cells1sizeof(Cells1), "Status: ( Offline )\n");
    }
    
format(Cellssizeof(Cells), "Dinheiro: %d",cash);
    
format(Cells3sizeof(Cells3), "Administrador: %s",Adminrank);
    
format(Cells2sizeof(Cells2), "==> %s's Status"params);
    
SendClientMessage(playerid, -1Cells1);
    
SendClientMessage(playerid, -1Cells2);
    
SendClientMessage(playerid, -1Cells);
    
SendClientMessage(playerid, -1Cells3);
    return 
true;
    }
    else
    {

        
SendClientMessage(playerid,-1,"ERRO: Voce nгo pode ter acesso a este comando!");
        return 
1;

    }

Teste...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)