[AJUDA]Erro de Comandos
#1

Boa tarde, alguem poderia me ajudar com os Comandos Abaixo? nгo sei se estгo errados ou oque й sempre da unknow comando quando digito algum comando!
pawn Код:
if(Prisao[playerid] == true)
        return SendClientMessage(playerid, -1, "Vocк nгo pode digitar nenhum comando enquanto estiver preso!");
    // Outros Comandos Abaixo
    if (strcmp("/creditos", cmdtext, true))
    {
        ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Creditos","GameMod: Exercito x Terrorista,\nFeito Por: Black_Trindade\nVersao 0.5 ","OK","Fechar");// Dialog 10
        return 1;
}
    if(strcmp(cmdtext, "/cv", true, 3)) //
  {
    if(cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Utilize: /cv [texto]");
    new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "%s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);

    if(strcmp(cmdtext,"/exercito", true))
    {
        SetPlayerPos(playerid,564.1640,897.5873,-43.0286);
        SetPlayerArmour(playerid, 100.0);
        SetPlayerHealth(playerid, 100.0);
        GivePlayerWeapon(playerid,4,1);
        GivePlayerWeapon(playerid,16,2);
        GivePlayerWeapon(playerid,25,100);
        GivePlayerWeapon(playerid,29,999);
        GivePlayerWeapon(playerid,34,100);
        GivePlayerWeapon(playerid,24,999);
        GivePlayerWeapon(playerid,31,999);
        SetPlayerSkin(playerid,287);
        SendClientMessage(playerid,-1,"Vocк ingressou no Exercito!!");
        BlackTrindade[playerid] = 1;
        return 1;
    }

if(strcmp(cmdtext,"/terrorista", true))
    {
        SetPlayerPos(playerid,564.1640,897.5873,-43.0286);
        SetPlayerArmour(playerid, 100.0);
        SetPlayerHealth(playerid, 100.0);
        GivePlayerWeapon(playerid,4,1);
        GivePlayerWeapon(playerid,16,2);
        GivePlayerWeapon(playerid,25,100);
        GivePlayerWeapon(playerid,29,999);
        GivePlayerWeapon(playerid,34,100);
        GivePlayerWeapon(playerid,24,999);
        GivePlayerWeapon(playerid,30,999);
        SetPlayerSkin(playerid,112);
        SendClientMessage(playerid,-1,"Vocк agora й um Terrorista!!");
        BlackTrindade[playerid] = 2;
        return 1;
    }
Obrigado Pela Atenзгo (+ Rep)
Reply
#2

Tenta...
PHP код:
    if(Prisao[playerid] == true)
        return 
SendClientMessage(playerid, -1"Vocк nгo pode digitar nenhum comando enquanto estiver preso!");
    
// Outros Comandos Abaixo
    
if (strcmp("/creditos"cmdtexttrue))
    {
        
ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Creditos","GameMod: Exercito x Terrorista,\nFeito Por: Black_Trindade\nVersao 0.5 ","OK","Fechar");// Dialog 10
        
return 1;
    }
    if(
strcmp(cmdtext"/cv"true3)) //
      
{
        if(
cmdtext[3])return SendClientMessage(playerid0xFF0000FF"Utilize: /cv [texto]");
        new 
str[128];
        
GetPlayerName(playeridstrsizeof(str));
        
format(strsizeof(str), "%s %s"strcmdtext[4]);
        
SendClientMessageToAll(0xFFFF00AAstr);
        return 
true;
    }

    if(
strcmp(cmdtext,"/exercito"true))
    {
        
SetPlayerPos(playerid,564.1640,897.5873,-43.0286);
        
SetPlayerArmour(playerid100.0);
        
SetPlayerHealth(playerid100.0);
        
GivePlayerWeapon(playerid,4,1);
        
GivePlayerWeapon(playerid,16,2);
        
GivePlayerWeapon(playerid,25,100);
        
GivePlayerWeapon(playerid,29,999);
        
GivePlayerWeapon(playerid,34,100);
        
GivePlayerWeapon(playerid,24,999);
        
GivePlayerWeapon(playerid,31,999);
        
SetPlayerSkin(playerid,287);
        
SendClientMessage(playerid,-1,"Vocк ingressou no Exercito!!");
        
BlackTrindade[playerid] = 1;
        return 
1;
    }
    if(
strcmp(cmdtext,"/terrorista"true))
    {
        
SetPlayerPos(playerid,564.1640,897.5873,-43.0286);
        
SetPlayerArmour(playerid100.0);
        
SetPlayerHealth(playerid100.0);
        
GivePlayerWeapon(playerid,4,1);
        
GivePlayerWeapon(playerid,16,2);
        
GivePlayerWeapon(playerid,25,100);
        
GivePlayerWeapon(playerid,29,999);
        
GivePlayerWeapon(playerid,34,100);
        
GivePlayerWeapon(playerid,24,999);
        
GivePlayerWeapon(playerid,30,999);
        
SetPlayerSkin(playerid,112);
        
SendClientMessage(playerid,-1,"Vocк agora й um Terrorista!!");
        
BlackTrindade[playerid] = 2;
        return 
1;
    } 
Reply
#3

Ageitei no GM no entanto deu estes erros

D:\Documentos\Desktop\samp\gamemodes\new.pwn(446) : warning 209: function "zcmd_OnPlayerCommandText" should return a value
D:\Documentos\Desktop\samp\gamemodes\new.pwn(446 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(449 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(451 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(453 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(455 ) : error 021: symbol already defined: "GetPlayerName"
D:\Documentos\Desktop\samp\gamemodes\new.pwn(458 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(461 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(476 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(478 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(493 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(495 ) : error 010: invalid function or declaration
D:\Documentos\Desktop\samp\gamemodes\new.pwn(628 ) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Documentos\Desktop\samp\gamemodes\new.pwn(697) : warning 203: symbol is never used: "str"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Linha 446:
pawn Код:
if (strcmp("/creditos", cmdtext, true))
Linha 449 a 461:
pawn Код:
449:        return 1;
450:    }
451:    if(strcmp(cmdtext, "/cv", true, 3)) //
452:      {
453:        if(cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Utilize: /cv [texto]");
454:        new str[128];
455        GetPlayerName(playerid, str, sizeof(str));
456        format(str, sizeof(str), "%s %s", str, cmdtext[4]);
457        SendClientMessageToAll(0xFFFF00AA, str);
458        return true;
459    }
460
461    if(strcmp(cmdtext,"/exercito", true))
Linha 476 a 478:
pawn Код:
476        return 1;
477    }
478    if(strcmp(cmdtext,"/terrorista", true))
Linmhas 493 a 496:
pawn Код:
493        return 1;
494    }
495    return 0;
496    }
Reply
#4

voce usa zcmd?
Reply
#5

acho que nao

No entanto ja tentei usar e tem atй a include no topo do gm aqui!
:/
Reply
#6

Se a include estiver no topo do GM retire-a, ela da conflito entre com OnPlayerCommandText...
Reply
#7

tirei no entanto os erros continuгo!
Reply
#8

Lol... me passa o OnPlayerCommandText
Reply
#9

pega ai:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    if(Prisao[playerid] == 1) return SendClientMessage(playerid, -1, "Vocк nгo pode digitar nenhum comando enquanto estiver preso!");
   
   // Outros Comandos Abaixo
    if (strcmp("/creditos", cmdtext, true))
    {
        ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Creditos","GameMod: Exercito x Terrorista,\nFeito Por: Black_Trindade\nVersao 0.5 ","OK","Fechar");// Dialog 10
        return 1;
    }
    if(strcmp(cmdtext, "/cv", true, 3)) //
    {
    if(cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Utilize: /cv [texto]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "%s %s", str, cmdtext[4]);
    SendClientMessageToAll(0xFFFF00AA, str);
    return 1;
    }

    if(strcmp(cmdtext,"/exercito", true))
    {
        SetPlayerPos(playerid,564.1640,897.5873,-43.0286);
        SetPlayerArmour(playerid, 100.0);
        SetPlayerHealth(playerid, 100.0);
        GivePlayerWeapon(playerid,4,1);
        GivePlayerWeapon(playerid,16,2);
        GivePlayerWeapon(playerid,25,100);
        GivePlayerWeapon(playerid,29,999);
        GivePlayerWeapon(playerid,34,100);
        GivePlayerWeapon(playerid,24,999);
        GivePlayerWeapon(playerid,31,999);
        SetPlayerSkin(playerid,287);
        SendClientMessage(playerid,-1,"Vocк ingressou no Exercito!!");
        BlackTrindade[playerid] = 1;
        return 1;
    }

    if(strcmp(cmdtext,"/terrorista", true))
    {
        SetPlayerPos(playerid,564.1640,897.5873,-43.0286);
        SetPlayerArmour(playerid, 100.0);
        SetPlayerHealth(playerid, 100.0);
        GivePlayerWeapon(playerid,4,1);
        GivePlayerWeapon(playerid,16,2);
        GivePlayerWeapon(playerid,25,100);
        GivePlayerWeapon(playerid,29,999);
        GivePlayerWeapon(playerid,34,100);
        GivePlayerWeapon(playerid,24,999);
        GivePlayerWeapon(playerid,30,999);
        SetPlayerSkin(playerid,112);
        SendClientMessage(playerid,-1,"Vocк agora й um Terrorista!!");
        BlackTrindade[playerid] = 2;
        return 1;
    }
    return SendClientMessage(playerid, -1, "comando invalido");
}
Reply
#10

Oh stell dark obrigado! +rep

So deu um Warning

D:\Documentos\Desktop\samp\gamemodes\new.pwn(441) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Linha 441:
pawn Код:
if(Prisao[playerid] == 1) return SendClientMessage(playerid, -1, "Vocк nгo pode digitar nenhum comando enquanto estiver preso!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)