Cmd Not worked !!!
#1

Hi Guys i created this command:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp(cmdtext, "/reclass", true) == 0)
{
    ShowPlayerDialog(playerid, classes, DIALOG_STYLE_LIST, "Class Select", " Pilot\n Air Traffic Controller\n Air Force", "Select", "Cancel");
}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(!response) return 0;

        switch(listitem)
        {
            case 0: ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            case 1: ShowPlayerDialog(playerid, atc, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            case 2: ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
        }
        return 1;
    }

    if(dialogid == pilot)
    {
        if(!response) return 0;

        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935, 1258.7944, 10.8203);//LVA
                SetPlayerFacingAngle(playerid, 359.1960);
                SetPlayerColor(playerid, 0x2641FEAA);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995, 18.6769, 14.1484);//SFA
                SetPlayerFacingAngle(playerid, 140.7841);
                SetPlayerColor(playerid, 0x2641FEAA);
            }
            case 2:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378, -2453.3921, 13.5469);//LSA
                SetPlayerFacingAngle(playerid, 93.1549);
                SetPlayerColor(playerid, 0x2641FEAA);
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(!response) return 0;

        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412, 2023.7921, 22.6406);//area51
                SetPlayerFacingAngle(playerid, 94.1359);
                SetPlayerColor(playerid, 0xFF9900);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959, 497.1472, 18.2344);//SFC
                SetPlayerFacingAngle(playerid, 358.6761);
                SetPlayerColor(playerid, 0xFF9900);
            }
        }
        return 1;
    }
    return 1;
}
But when i type /reclass in game nothing happen !! why ?

Thx in advance
Avi.
Reply
#2

It's a FS or GM?
Reply
#3

At the top of your gamemode,you should have:
pawn Код:
#define classes 1
//or it depends on the numbers of your dialog
Reply
#4

Its FS And the whole FS is here:
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define classes 1001
#define pilot 1002
#define airforce 1003
#define atc 1004

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	
	
	public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp(cmdtext, "/reclass", true) == 0)
{
    ShowPlayerDialog(playerid, classes, DIALOG_STYLE_LIST, "Class Select", " Pilot\n Air Traffic Controller\n Air Force", "Select", "Cancel");
}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(!response) return 0;

        switch(listitem)
        {
            case 0: ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            case 1: ShowPlayerDialog(playerid, atc, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            case 2: ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
        }
        return 1;
    }

    if(dialogid == pilot)
    {
        if(!response) return 0;

        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935, 1258.7944, 10.8203);//LVA
                SetPlayerFacingAngle(playerid, 359.1960);
                SetPlayerColor(playerid, 0x2641FEAA);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995, 18.6769, 14.1484);//SFA
                SetPlayerFacingAngle(playerid, 140.7841);
                SetPlayerColor(playerid, 0x2641FEAA);
            }
            case 2:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378, -2453.3921, 13.5469);//LSA
                SetPlayerFacingAngle(playerid, 93.1549);
                SetPlayerColor(playerid, 0x2641FEAA);
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(!response) return 0;

        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412, 2023.7921, 22.6406);//area51
                SetPlayerFacingAngle(playerid, 94.1359);
                SetPlayerColor(playerid, 0xFF9900);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959, 497.1472, 18.2344);//SFC
                SetPlayerFacingAngle(playerid, 358.6761);
                SetPlayerColor(playerid, 0xFF9900);
            }
        }
        return 1;
    }
    return 1;
    #endif
Reply
#5

You haven't uncommented the FS line(3rd line on the code)
Reply
#6

can anyone do that for me i didnt got what u siad
Reply
#7

Try put return 0;
Reply
#8

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
Replace that with:

pawn Код:
#define FILTERSCRIPT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)