[Ajuda] BUG /KICK
#1

Bom galera quando eu vou kick eu ou um jogador nгo aparece mostrando exemplo: Admin: Petrick Kickou Fulano Motivo: bug

Se alguйm me ajuda agradeзo olha o codigo

PHP код:
//----------------------------------[Kick]------------------------------------------------
    
if(strcmp(cmd"/kick"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /kick [Id Do Jogador] [motivo]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != 10 && PlayerInfo[playerid][pAdmin] != 9)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/trabalhar)");
                    return 
1;
                }
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
PlayerInfo[giveplayerid][pAdmin] >= && PlayerInfo[playerid][pAdmin] < 6)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode kickar um Admin Dono !");
                            return 
1;
                        }
                         
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[64];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /kick [Id Do Jogador] [motivo]");
                            return 
1;
                        }
                        
getdate(yearmonthday);
                        if(
admtrampando[playerid] == && admhide[playerid] == 1)
                        {
                            
format(stringsizeof(string), "AdmCmd: %s foi kickado por Chuck(Modo Cia), Motivo: %s (%d-%d-%d)"giveplayer, (result),day,month,year);
                            
//KickLog(string);
                            
format(stringsizeof(string), "AdmCmd: %s foi kickado por Chuck, Motivo: %s"giveplayer, (result));
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        else
                        {
                            
format(stringsizeof(string), "AdmCmd: %s foi kickado por %s, Motivo: %s (%d-%d-%d)"giveplayersendername, (result),day,month,year);
                            
//KickLog(string);
                            
format(stringsizeof(string), "AdmCmd: %s foi kickado por %s, Motivo: %s"giveplayersendername, (result));
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        
Kick(giveplayerid);
                        return 
1;
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Esse nгo й um jogador ativo.");
            }
        }
        return 
1;
    } 
Reply
#2

PHP код:
#define Kick(%0) SetTimerEx("KickFox", 100, false, "i", %0)
forward KickFox(p); public KickFox(p) {
    
#undef Kick
    
Kick(p);
    
#define Kick(%0) SetTimerEx("KickFox", 100, false, "i", %0)
    
return 1;

Reply
#3

Quote:
Originally Posted by iFox
Посмотреть сообщение
PHP код:
#define Kick(%0) SetTimerEx("KickFox", 100, false, "i", %0)
forward KickFox(p); public KickFox(p) {
    
#undef Kick
    
Kick(p);
    
#define Kick(%0) SetTimerEx("KickFox", 100, false, "i", %0)
    
return 1;

Mano й pq antigamente pegava, e agr parou de pega do nada
Reply
#4

Powers, vocк tem que dar um tempo um espaзo de tempo entre o kick e a mensagem.
Coloca o code que o Fox mandou no seu gm/fs que vai dar certo!
Reply
#5

Alguйm tem como ajudar?
Reply
#6

Quote:
Originally Posted by Powers
Посмотреть сообщение
Alguйm tem como ajudar?
Tenta ai;

PHP код:
    if(strcmp(cmd"/kick"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /kick [Id Do Jogador] [motivo]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != 1342)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/trabalhar)");
                    return 
1;
                }
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
PlayerInfo[giveplayerid][pAdmin] >= 1340 && PlayerInfo[playerid][pAdmin] < 1338)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode kickar um Admin Dono !");
                            return 
1;
                        }
                         
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[64];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /kick [Id Do Jogador] [motivo]");
                            return 
1;
                        }
                        
getdate(yearmonthday);
                        if(
admtrampando[playerid] == && admhide[playerid] == 1)
                        {
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por ADMIM_BOT, Motivo: %s (%d-%d-%d)"giveplayer, (result),day,month,year);
                            
KickLog(string);
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por ADMIM_BOT, Motivo: %s"giveplayer, (result));
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        else
                        {
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por %s, Motivo: %s (%d-%d-%d)"giveplayersendername, (result),day,month,year);
                            
KickLog(string);
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por %s, Motivo: %s"giveplayersendername, (result));
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        
Kick(giveplayerid);
                        return 
1;
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Esse nгo й um jogador ativo.");
            }
        }
        return 
1;
    } 
Reply
#7

Quote:
Originally Posted by Dick_Vigarista
Посмотреть сообщение
Tenta ai;

PHP код:
    if(strcmp(cmd"/kick"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /kick [Id Do Jogador] [motivo]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != 1342)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/trabalhar)");
                    return 
1;
                }
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
PlayerInfo[giveplayerid][pAdmin] >= 1340 && PlayerInfo[playerid][pAdmin] < 1338)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode kickar um Admin Dono !");
                            return 
1;
                        }
                         
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[64];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /kick [Id Do Jogador] [motivo]");
                            return 
1;
                        }
                        
getdate(yearmonthday);
                        if(
admtrampando[playerid] == && admhide[playerid] == 1)
                        {
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por ADMIM_BOT, Motivo: %s (%d-%d-%d)"giveplayer, (result),day,month,year);
                            
KickLog(string);
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por ADMIM_BOT, Motivo: %s"giveplayer, (result));
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        else
                        {
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por %s, Motivo: %s (%d-%d-%d)"giveplayersendername, (result),day,month,year);
                            
KickLog(string);
                            
format(stringsizeof(string), "[AVISO] %s foi kickado por %s, Motivo: %s"giveplayersendername, (result));
                            
SendClientMessageToAll(COLOR_LIGHTREDstring);
                        }
                        
Kick(giveplayerid);
                        return 
1;
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Esse nгo й um jogador ativo.");
            }
        }
        return 
1;
    } 
PHP код:
C:\Users\PlayNow\Desktop\PlayNow\gamemodes\BPN.pwn(33605) : error 017undefined symbol "KickLog"
C:\Users\PlayNow\Desktop\PlayNow\gamemodes\BPN.pwn(33612) : error 017undefined symbol "KickLog" 
Reply
#8

Quote:
Originally Posted by Powers
Посмотреть сообщение
PHP код:
C:\Users\PlayNow\Desktop\PlayNow\gamemodes\BPN.pwn(33605) : error 017undefined symbol "KickLog"
C:\Users\PlayNow\Desktop\PlayNow\gamemodes\BPN.pwn(33612) : error 017undefined symbol "KickLog" 
forward KickLog(string[]);

PHP код:
public KickLog(string[])
{
    new 
entry[128];
    
format(entrysizeof(entry), "%s\n",string);
    new 
File:hFile;
    
hFile fopen("Logs/kick.log"io_append);
    
fwrite(hFileentry);
    
fclose(hFile);

Vai na pasta scriptfiles > Cria uma pasta chamada " LOGS " e dentro dela cria um bloco de notas chamado: Kick.log

vк se funfa.
Reply
#9

Basta colocar o Code que o paulor postou.
PHP код:
// Topo do GM
#define Kick(%0) SetTimerEx("KickFox", 100, false, "i", %0) 
forward KickFox(p); public KickFox(p) { 
    
#undef Kick 
    
Kick(p); 
    
#define Kick(%0) SetTimerEx("KickFox", 100, false, "i", %0) 
    
return 1

Reply
#10

Quer que apareзa para todos os players online ou para o player que foi kickado?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)