[Ajuda] Comando /kick nгo funcionando
#1

Rapaziada eu coloquei esse comando /kick, mais quando vou testa ele nгo kika '-'

if(strcmp(cmdtext,"/kick",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pCbf] >= 1)
SendClientMessage(playerid,0xFFFFFFAA,"Use /Kick [ID/Nome][Motivo]");
return 1;
}
new kickado = strval(tmp);
new kickadoname[MAX_PLAYER_NAME];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
if(!strlen(result))
{
SendClientMessage(playerid,BRANCO,"Use /Kick[ID][Motivo]");
return 1;
}
GetPlayerName(kickado,kickadoname,sizeof(kickadona me));
format(string,sizeof(string),"%s Foi Kickado Pelo %s %s, Motivo: %s",kickadoname,pNome(playerid),result);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
Reply
#2

Vocк esqueceu o mais importante: a funзгo Kick no fim do comando.
Reply
#3

@Post_Abaixo;
Reply
#4

pawn Код:
if(strcmp(cmdtext,"/kick",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pCbf] >= 1)
SendClientMessage(playerid,0xFFFFFFAA,"Use /Kick [ID/Nome][Motivo]");
return 1;
}
new kickado = strval(tmp);
new kickadoname[MAX_PLAYER_NAME];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
if(!strlen(result))
{
SendClientMessage(playerid,BRANCO,"Use /Kick[ID][Motivo]");
return 1;
}
GetPlayerName(kickado,kickadoname,sizeof(kickadona me));
format(string,sizeof(string),"%s Foi Kickado Pelo %s %s, Motivo: %s",kickadoname,pNome(playerid),result);
SendClientMessageToAll(0xFFFFFFAA,string);
Kick(kickado); // Esqueceu De Kickar O Player Que Foi Alvo Do Kick?? :D
return 1;
}
Reply
#5

Quote:
Originally Posted by SkyneTSAMP
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext,"/kick",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pCbf] >= 1)
SendClientMessage(playerid,0xFFFFFFAA,"Use /Kick [ID/Nome][Motivo]");
return 1;
}
new kickado = strval(tmp);
new kickadoname[MAX_PLAYER_NAME];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
if(!strlen(result))
{
SendClientMessage(playerid,BRANCO,"Use /Kick[ID][Motivo]");
return 1;
}
GetPlayerName(kickado,kickadoname,sizeof(kickadona me));
format(string,sizeof(string),"%s Foi Kickado Pelo %s %s, Motivo: %s",kickadoname,pNome(playerid),result);
SendClientMessageToAll(0xFFFFFFAA,string);
Kick(kickado); // Esqueceu De Kickar O Player Que Foi Alvo Do Kick?? :D
return 1;
}
error 017: undefined symbol "kickadona"
error 017: undefined symbol "me"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
4 erros '-'
Reply
#6

Mas antes defina o ID

PHP код:
id strval(tmp);

Kick(id); 
Reply
#7

Quote:
Originally Posted by ApocaSamp
Посмотреть сообщение
Mas antes defina o ID

PHP код:
id strval(tmp);
Kick(id); 
ISSO NO COMANDO?
Reply
#8

PHP код:
if(strcmp(cmd"/kick"true) == 0)
{
    
id strval(tmp);
    
GetPlayerName(idgiveplayersizeof(giveplayer));
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp))
    {
        
SendClientMessage(playerid,-1"Uso: /kick [id do player] [motivo]");
        return 
1;
    }
    
id strval(tmp);
    {
    if(
IsPlayerConnected(id))
    {
        new 
length strlen(cmdtext);
        while ((
idx length) && (cmdtext[idx] <= ' '))
        {
            
idx++;
        }
        new 
offset idx;
        new 
result[350];
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1))) {
            
result[idx offset] = cmdtext[idx];
            
idx++;
        }
        
result[idx offset] = EOS;
        if(!
strlen(result))
        {
            
result "N/A";
        }
        
GetPlayerName(idgiveplayersizeof(giveplayer));
        
format(stringsizeof(string), "%s foi kickado pelo %s | Motivo: %s"giveplayer,sendername,result);
        
SendClientMessageToAll(-1string);
        
Kick(id);
    }
    return 
1;

Reply
#9

Da Onde Vocк Tirou "kickadona"? Seria "kickado"..

pawn Код:
new kickado = strval(tmp);
Reply
#10

Quote:
Originally Posted by SkyneTSAMP
Посмотреть сообщение
Da Onde Vocк Tirou "kickadona"? Seria "kickado"..

pawn Код:
new kickado = strval(tmp);
poderia colocar o code completo nгo entendir direito n
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)