This command does not work
#1

It compiles fine, but when i type it in game, nothing happens and it says "command not found". i don't know...

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

    if(!strcmp(cmdtext, "/disguise", true))//dialog which tells u about the spy class disguises
        {

        if(gClass[playerid] == SPY)
        {
             ShowPlayerDialog(playerid, 88, DIALOG_STYLE_MSGBOX, "{6EF83C}Spy - Disguise Kit:", "/England\n/Soviet Union\n/Taliban\n/United States\n/Australian Armada", "Disguise ","Exit");//Replace the team1,2,3 to your game teams name and colors, by /team1 or /team2 or / team3 the player gets disguise to enemy soldier but don't changes its team
             return 1;
        }
    }

    if(!strcmp(cmdtext, "/england", true))//This is for disguise to team 1
        {

        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as England:", "Team: England\nColor: Green\nSkin: 124", "Disguise ","");
             SetPlayerSkin(playerid,124);//skin set to S.W.A.T, can change to ur team skin
             SetPlayerColor(playerid,C_GREEN);//Color Red
             return 1;
        }
    }

    if(!strcmp(cmdtext, "/sovietunion", true))//This is for disguise to team 2
        {

        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as Soviet Union:", "Team: Soviet Union\nColor: Red\nSkin: 206", "Disguise ","");
             SetPlayerSkin(playerid,206);//skin set to Military, can change to ur team skin
             SetPlayerColor(playerid,C_RED);//Color white
             return 1;
        }
    }

    if(!strcmp(cmdtext, "/taliban", true))//This is for disguise to team 1
        {

        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 33, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as Taliban:", "Team: Taliban\nColor: Yellow\nSkin: 128", "Disguise ","");
             SetPlayerSkin(playerid,128);//skin set to Rockstar, can change to ur team skin
             SetPlayerColor(playerid,C_YELLOW);//Color green
             return 1;
        }
    }
   
    if(!strcmp(cmdtext, "/unitedstates", true))//This is for disguise to team 2
        {

        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as United States:", "Team: United States\nColor: Blue\nSkin: 103", "Disguise ","");
             SetPlayerSkin(playerid,103);//skin set to Military, can change to ur team skin
             SetPlayerColor(playerid,C_BLUE);//Color white
             return 1;
        }
    }
   
    if(!strcmp(cmdtext, "/australia", true))//This is for disguise to team 2
        {

        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as Australian Armada:", "Team: Australian Armada\nColor: Purple\nSkin: 73", "Disguise ","");
             SetPlayerSkin(playerid,73);//skin set to Military, can change to ur team skin
             SetPlayerColor(playerid,C_PURPLE);//Color white
             return 1;
        }
    }
    return 0;
Reply
#2

The return 1; should really be at the end of your command. Otherwise, use this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    if(!strcmp(cmdtext, "/disguise", true))//dialog which tells u about the spy class disguises
    {
        if(gClass[playerid] == SPY)
        {
             ShowPlayerDialog(playerid, 88, DIALOG_STYLE_MSGBOX, "{6EF83C}Spy - Disguise Kit:", "/England\n/Soviet Union\n/Taliban\n/United States\n/Australian Armada", "Disguise ","Exit");//Replace the team1,2,3 to your game teams name and colors, by /team1 or /team2 or / team3 the player gets disguise to enemy soldier but don't changes its team
             return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
    }

    if(!strcmp(cmdtext, "/england", true))//This is for disguise to team 1
    {
        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as England:", "Team: England\nColor: Green\nSkin: 124", "Disguise ","");
             SetPlayerSkin(playerid,124);//skin set to S.W.A.T, can change to ur team skin
             SetPlayerColor(playerid,C_GREEN);//Color Red
             return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
    }

    if(!strcmp(cmdtext, "/sovietunion", true))//This is for disguise to team 2
    {
        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as Soviet Union:", "Team: Soviet Union\nColor: Red\nSkin: 206", "Disguise ","");
             SetPlayerSkin(playerid,206);//skin set to Military, can change to ur team skin
             SetPlayerColor(playerid,C_RED);//Color white
             return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
    }

    if(!strcmp(cmdtext, "/taliban", true))//This is for disguise to team 1
    {
        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 33, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as Taliban:", "Team: Taliban\nColor: Yellow\nSkin: 128", "Disguise ","");
             SetPlayerSkin(playerid,128);//skin set to Rockstar, can change to ur team skin
             SetPlayerColor(playerid,C_YELLOW);//Color green
             return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
    }
   
    if(!strcmp(cmdtext, "/unitedstates", true))//This is for disguise to team 2
    {
        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as United States:", "Team: United States\nColor: Blue\nSkin: 103", "Disguise ","");
             SetPlayerSkin(playerid,103);//skin set to Military, can change to ur team skin
             SetPlayerColor(playerid,C_BLUE);//Color white
             return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
    }
   
    if(!strcmp(cmdtext, "/australia", true))//This is for disguise to team 2
    {
        if(gClass[playerid] == SPY)//if player class spy
        {
             ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguise as Australian Armada:", "Team: Australian Armada\nColor: Purple\nSkin: 73", "Disguise ","");
             SetPlayerSkin(playerid,73);//skin set to Military, can change to ur team skin
             SetPlayerColor(playerid,C_PURPLE);//Color white
             return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
    }
    return 0;
}
Reply
#3

So you just added this to it?
pawn Код:
else return
Even if i didn't put the below
pawn Код:
else return SendClientMessage(playerid, 0xFF0000FF, "You must be a spy to use this command.");
the command should still work regardless don't you think!?
Reply
#4

Use zcmd mate, its way faster and easier
Reply
#5

Quote:
Originally Posted by Apenmeeuw
Посмотреть сообщение
Use zcmd mate, its way faster and easier
I have ZCMD. Normally on this gamemode i use
Quote:

CMD:Hello

, how would i convert it to CMD: or something that works?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)