[Ajuda] Comando Kick
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strccmd(cmd,"/kick",true)==0){
new aname[MAX_PLAYERS_NAME];
GetPlayerName(playerid,aname,MAX_PLAYERS_NAME);
format(file,sizeof(file),CONTAS,aname);
if{pAdmin[playerid]== 1){
new tmp[256]
strmid{tmp,cmdtext, 2,strlen(cmdtext));
if(lsrlen(tmp))[
SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
return 1;
}else[
 format(string,sizeof(string, |ADMIN-CMD| O Administrador %s Kikcou o Jogador %!"
aname,tmp);
return 1;
SendClientMessage,playerid,azul" |ERRO| Vocк nгo tem Permissгo para Executar este Comando!);
                }
           return 1;
            }
Erros:
pawn Код:
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(95) : error 017: undefined symbol "strccmd"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : error 017: undefined symbol "MAX_PLAYERS_NAME"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : error 036: empty statement
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(96) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Se alguem conseguir arrumar o erro ou tiver os comandos basicos /kick, /ban fala aew, abrзs !
Reply
#2

Olб JokerHurley!

Creio que vocк copiou algo a mais ou a menos. Confira por favor.

Vlw!
Reply
#3

Tente:
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmd,"/kick",true)==0)
    {
        new 
aname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
        
format(file,sizeof(file),CONTAS,aname);
        if(
pAdmin[playerid]== 1)
        {
            new 
tmp[256]
            
strmid(tmp,cmdtext2,strlen(cmdtext));
            if(!
srlen(tmp)) 
            {
                
SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
                return 1;
            }
            else
            {
                format(string,sizeof(string), "
|ADMIN-CMDO Administrador %s Kikcou o Jogador %!"aname,tmp);
                return 1;
                SendClientMessage,playerid,azul," 
|ERROVocк nгo tem Permissгo para Executar este Comando!");
            }
            return 1;
        } 
Reply
#4

Quote:
Originally Posted by DanDRT
Посмотреть сообщение
Tente:
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmd,"/kick",true)==0)
    {
        new 
aname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
        
format(file,sizeof(file),CONTAS,aname);
        if(
pAdmin[playerid]== 1)
        {
            new 
tmp[256]
            
strmid(tmp,cmdtext2,strlen(cmdtext));
            if(!
srlen(tmp)) 
            {
                
SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]");
                return 
1;
            }
            else
            {
                
format(string,sizeof(string), |ADMIN-CMDO Administrador %s Kikcou o Jogador %!"aname,tmp);
                return 1;
                SendClientMessage,playerid,azul," 
|ERROVocк nгo tem Permissгo para Executar este Comando!");
            }
            return 1;
        } 
Isso vai dar erro..
pawn Код:
if(strcmp(cmd,"/kick",true)==0)
    {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
        format(file,sizeof(file),CONTAS,aname);
        if(pAdmin[playerid] != 1) return false;
        new tmp[256]
        strmid(tmp,cmdtext, 2,strlen(cmdtext));
        if(!srlen(tmp))
            return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]");
        format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!",aname,tmp);
        SendClientMessageToAll(azul,string);
        SendClientMessage(playerid,azul," |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
        return 1;
    }
Reply
#5

Quote:
Originally Posted by tonisantolia
Посмотреть сообщение
Isso vai dar erro..
pawn Код:
if(strcmp(cmd,"/kick",true)==0)
    {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
        format(file,sizeof(file),CONTAS,aname);
        if(pAdmin[playerid] != 1) return false;
        new tmp[256]
        strmid(tmp,cmdtext, 2,strlen(cmdtext));
        if(!srlen(tmp))
            return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
        format(string,sizeof(string), "
|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!",aname,tmp);
        SendClientMessageToAll(azul,string);
        SendClientMessage(playerid,azul,"
|ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
        return 1;
    }
Eu Deixei do Jeito que ele postou So Corrigi:
" - que faltavam
! - que estavam definidas como l
E o MAX_PLAYER_NAME - que tava com o S dps de player '-'
Reply
#6

pawn Код:
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(95) : error 017: undefined symbol "cmd"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : error 017: undefined symbol "file"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : error 017: undefined symbol "file"
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\Matheus\Desktop\GTA\Brasil PlayCity - Cуpia\gamemodes\BSG.pwn(99) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#7

Quote:
Originally Posted by DanDRT
Посмотреть сообщение
Eu Deixei do Jeito que ele postou So Corrigi:
" - que faltavam
! - que estavam definidas como l
E o MAX_PLAYER_NAME - que tava com o S dps de player '-'
O Meu tambem tava errado jб arrumei:
pawn Код:
if(strcmp(cmd,"/kick",true)==0)
    {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
        format(file,sizeof(file),CONTAS,aname);
        if(pAdmin[playerid] != 1) return false;
        new tmp[256]
        strmid(tmp,cmdtext, 2,strlen(cmdtext));
        if(!srlen(tmp))
            return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]");
        format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!",aname,tmp);
        SendClientMessageToAll(azul,string);
        SendClientMessage(playerid,azul," |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
        return 1;
    }
O Seu faltava " virgulas e uma SendClientMessageToAll (fora a identaзгo).
Reply
#8

n entendi uma coisa o cmd й pra kickar o player kd o Kick??
Reply
#9

gente, melhor alguem pode enviar o cmd kick e ban simples ?
Reply
#10

Tente Agora...
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    
cmd strtok(cmdtextidx);
    
// - Comeзo dos Comandos - //
    
if(strcmp(cmd"/kick"true) == 0)
    {
        new 
aname[MAX_PLAYERS_NAME], file[40];
        
GetPlayerName(playerid,aname,MAX_PLAYERS_NAME);
        
format(file,sizeof(file),CONTAS,aname);
        if(
pAdmin[playerid] != 1) return false;
        
strmid(tmp,cmdtext2,strlen(cmdtext));
        if(!
srlen(tmp)) return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
        format(string,sizeof(string), "
|ADMIN-CMDO Administrador %s Kikcou o Jogador %!" aname,tmp);
        SendClientMessage,playerid,azul" 
|ERROVocк nгo tem Permissгo para Executar este Comando!");
    }
    return 1;

Final do GM/FS
PHP код:
strtok(const string[], &index)
{
        new 
length strlen(string);
        while ((
index length) && (string[index] <= ' '))
        {
                
index++;
        }
        new 
offset index;
        new 
result[20];
        while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
        {
                
result[index offset] = string[index];
                
index++;
        }
        
result[index offset] = EOS;
        return 
result;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)