SA-MP Forums Archive
Unkown Command issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unkown Command issue (/showthread.php?tid=515224)



Unkown Command issue - Shockey HD - 25.05.2014

I've created the code

pawn Код:
CMD:getpvehicle(playerid, params[])
{
    if(pData[playerid][pAdmin] >= 3)
    {
        new ID;
        if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_GREY,"Usage: /GetPVehicle [Player ID]");
        {
            new TitleString[64],BodyString[258];
            new Slot1Model = GetVehicleModel(pData[playerid][cSlot1]);
            new Slot2Model = GetVehicleModel(pData[playerid][cSlot2]);
            new Slot3Model = GetVehicleModel(pData[playerid][cSlot3]);
            new Slot4Model = GetVehicleModel(pData[playerid][cSlot4]);
            new Slot5Model = GetVehicleModel(pData[playerid][cSlot5]);
            new Slot6Model = GetVehicleModel(pData[playerid][cSlot6]);
            format(TitleString, sizeof TitleString, "%s's Vehicles", RemoveUnderLine(GetName(ID)));
            format(BodyString, sizeof BodyString, "%s\n%s\%s\%s\%s\%s", GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model) );
            ShowPlayerDialog(playerid, DIALOG_PVEHICLE, DIALOG_STYLE_LIST, TitleString, BodyString, "Teleport", "Cancel");
        }
    }
    return 1;
}

And its dishing me a unknown command error and it's not showing the dialog.

What could be the issue?


Re: Unkown Command issue - JFF - 25.05.2014

pawn Код:
CMD:getpvehicle(playerid, params[])
{
    if(pData[playerid][pAdmin] >= 3)
    {
        new ID;
        if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_GREY,"Usage: /GetPVehicle [Player ID]");
        new TitleString[64],BodyString[258];
        new Slot1Model = GetVehicleModel(pData[playerid][cSlot1]);
        new Slot2Model = GetVehicleModel(pData[playerid][cSlot2]);
        new Slot3Model = GetVehicleModel(pData[playerid][cSlot3]);
        new Slot4Model = GetVehicleModel(pData[playerid][cSlot4]);
        new Slot5Model = GetVehicleModel(pData[playerid][cSlot5]);
        new Slot6Model = GetVehicleModel(pData[playerid][cSlot6]);
        format(TitleString, sizeof(TitleString), "%s's Vehicles", RemoveUnderLine(GetName(ID)));
        format(BodyString, sizeof(BodyString), "%s\n%s\%s\%s\%s\%s", GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model) );
        ShowPlayerDialog(playerid, DIALOG_PVEHICLE, DIALOG_STYLE_LIST, TitleString, BodyString, "Teleport", "Cancel");
        return 1;
    }
    return 1;
}
Try this


Re: Unkown Command issue - Shockey HD - 25.05.2014

Quote:
Originally Posted by JFF
Посмотреть сообщение
pawn Код:
CMD:getpvehicle(playerid, params[])
{
    if(pData[playerid][pAdmin] >= 3)
    {
        new ID;
        if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_GREY,"Usage: /GetPVehicle [Player ID]");
        else
        {
            new TitleString[64],BodyString[258];
            new Slot1Model = GetVehicleModel(pData[playerid][cSlot1]);
            new Slot2Model = GetVehicleModel(pData[playerid][cSlot2]);
            new Slot3Model = GetVehicleModel(pData[playerid][cSlot3]);
            new Slot4Model = GetVehicleModel(pData[playerid][cSlot4]);
            new Slot5Model = GetVehicleModel(pData[playerid][cSlot5]);
            new Slot6Model = GetVehicleModel(pData[playerid][cSlot6]);
            format(TitleString, sizeof(TitleString), "%s's Vehicles", RemoveUnderLine(GetName(ID)));
            format(BodyString, sizeof(BodyString), "%s\n%s\%s\%s\%s\%s", GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model) );
            ShowPlayerDialog(playerid, DIALOG_PVEHICLE, DIALOG_STYLE_LIST, TitleString, BodyString, "Teleport", "Cancel");
            return 1;
        }
    }
    return 1;
}
Try this
Negative, didn't work ;/


Re: Unkown Command issue - JFF - 25.05.2014

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
Negative, didn't work ;/
edited the code check it


Re: Unkown Command issue - Shockey HD - 25.05.2014

Quote:
Originally Posted by JFF
Посмотреть сообщение
edited the code check it
Nope..

Although it is a issue with this:

pawn Код:
GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model)
I'm assuming with GetVehicleName..


When I remove all of that code I am able to execute the dialog.. although there will be nothing in the dialog of course.


Re: Unkown Command issue - Rittik - 25.05.2014

Код:
CMD:getpvehicle(playerid, params[])
{
    if(pData[playerid][pAdmin] >= 3)
    {
        new ID;
        if(sscanf(params, "i", ID))
       {
        SendClientMessage(playerid, COLOR_GREY,"Usage: /GetPVehicle [Player ID]");
        return 1;
        }
        else
        {
            new TitleString[64],BodyString[258];
            new Slot1Model = GetVehicleModel(pData[playerid][cSlot1]);
            new Slot2Model = GetVehicleModel(pData[playerid][cSlot2]);
            new Slot3Model = GetVehicleModel(pData[playerid][cSlot3]);
            new Slot4Model = GetVehicleModel(pData[playerid][cSlot4]);
            new Slot5Model = GetVehicleModel(pData[playerid][cSlot5]);
            new Slot6Model = GetVehicleModel(pData[playerid][cSlot6]);
            format(TitleString, sizeof TitleString, "%s's Vehicles", RemoveUnderLine(GetName(ID)));
            format(BodyString, sizeof BodyString, "%s\n%s\%s\%s\%s\%s", GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model) );
            ShowPlayerDialog(playerid, DIALOG_PVEHICLE, DIALOG_STYLE_LIST, TitleString, BodyString, "Teleport", "Cancel");
        }
    }
    return 1;
}
Try this......


Re: Unkown Command issue - Shockey HD - 25.05.2014

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Код:
CMD:getpvehicle(playerid, params[])
{
    if(pData[playerid][pAdmin] >= 3)
    {
        new ID;
        if(sscanf(params, "i", ID))
       {
        SendClientMessage(playerid, COLOR_GREY,"Usage: /GetPVehicle [Player ID]");
        return 1;
        }
        else
        {
            new TitleString[64],BodyString[258];
            new Slot1Model = GetVehicleModel(pData[playerid][cSlot1]);
            new Slot2Model = GetVehicleModel(pData[playerid][cSlot2]);
            new Slot3Model = GetVehicleModel(pData[playerid][cSlot3]);
            new Slot4Model = GetVehicleModel(pData[playerid][cSlot4]);
            new Slot5Model = GetVehicleModel(pData[playerid][cSlot5]);
            new Slot6Model = GetVehicleModel(pData[playerid][cSlot6]);
            format(TitleString, sizeof TitleString, "%s's Vehicles", RemoveUnderLine(GetName(ID)));
            format(BodyString, sizeof BodyString, "%s\n%s\%s\%s\%s\%s", GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model) );
            ShowPlayerDialog(playerid, DIALOG_PVEHICLE, DIALOG_STYLE_LIST, TitleString, BodyString, "Teleport", "Cancel");
        }
    }
    return 1;
}
Try this......
Nope..

Why would GetVehicleName be returning a unknown command?


Re: Unkown Command issue - BroZeus - 25.05.2014

the issue is of missing plugin
make sure you are using nativeckecker sscanf streamer whirlpool and regex plugins
these are most widely used and are important
and if are using audio include then you must have audio plugin also


Re: Unkown Command issue - Shockey HD - 25.05.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
the issue is of missing plugin
make sure you are using nativeckecker sscanf streamer whirlpool and regex plugins
these are most widely used and are important
and if are using audio include then you must have audio plugin also
How woould getvehiclename need a plugin


Re : Unkown Command issue - yusei - 25.05.2014

try to use stcat

PHP код:
CMD:getpvehicle(playeridparams[])
{
    if(
pData[playerid][pAdmin] >= 3)
    {
        new 
ID;
        if(
sscanf(params"u"ID)) return SendClientMessage(playeridCOLOR_GREY,"Usage: /GetPVehicle [Player ID]");
        {
            new 
TitleString[64],BodyString[258];
            new 
Slot1Model GetVehicleModel(pData[playerid][cSlot1]);
            new 
Slot2Model GetVehicleModel(pData[playerid][cSlot2]);
            new 
Slot3Model GetVehicleModel(pData[playerid][cSlot3]);
            new 
Slot4Model GetVehicleModel(pData[playerid][cSlot4]);
            new 
Slot5Model GetVehicleModel(pData[playerid][cSlot5]);
            new 
Slot6Model GetVehicleModel(pData[playerid][cSlot6]);
            
format(TitleStringsizeof TitleString"%s's Vehicles"RemoveUnderLine(GetName(ID)));
            
format(BodyStringsizeof BodyString"%s\n%s\%s\%s\%s\%s"GetVehicleName(Slot1Model),GetVehicleName(Slot2Model),GetVehicleName(Slot3Model),GetVehicleName(Slot4Model),GetVehicleName(Slot5Model),GetVehicleName(Slot6Model) );
            
strcat(TitleString,BodyString);
            
ShowPlayerDialog(playeridDIALOG_PVEHICLEDIALOG_STYLE_LISTTitleString,"Teleport""Cancel");
        }
    }
    return 
1;