Server Command Fail
#1

I was just trying to check out the Glasses Filterscript. Filter script is loaded, but when i type /wearglasses it says Server: Unknown Command. I tried with other gamemodes too it always says, 'Server: Unknown Command' Need Help with it
Reply
#2

Error of return.
Make sure to return false in the script or missing return somewhere.
Reply
#3

Код:
{
	if (strcmp("/buyglasses", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid,25,DIALOG_STYLE_LIST,"Glasses","Glasses Type 1 \nGlasses Type 2 \nGlasses Type 3 \nGlasses Type 4 \nGlasses Type 5 \nGlasses Type 6 \nGlasses Type 7 \nGlasses Type 8 \nGlasses Type 9 \nGlasses Type 10 \nNext Page","Open","Close");
       	return 1;
	}
	if (strcmp("/removeglasses",cmdtext,true, 10) == 0)
	{
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
        return 1;
	}
	return 1;
}
Reply
#4

The latter return is the return of public OnPlayerCommandText? If so, switch to 0 or false.
Reply
#5

english please
Reply
#6

http://translate.******.com
Reply
#7

pawn Код:
{
    if (strcmp("/buyglasses", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,25,DIALOG_STYLE_LIST,"Glasses","Glasses Type 1 \nGlasses Type 2 \nGlasses Type 3 \nGlasses Type 4 \nGlasses Type 5 \nGlasses Type 6 \nGlasses Type 7 \nGlasses Type 8 \nGlasses Type 9 \nGlasses Type 10 \nNext Page","Open","Close");
        return 1;
    }
    if (strcmp("/removeglasses",cmdtext,true, 10) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
        return 1;
    }
    return 1;
}
Replace to

pawn Код:
{
    if (strcmp("/buyglasses", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,25,DIALOG_STYLE_LIST,"Glasses","Glasses Type 1 \nGlasses Type 2 \nGlasses Type 3 \nGlasses Type 4 \nGlasses Type 5 \nGlasses Type 6 \nGlasses Type 7 \nGlasses Type 8 \nGlasses Type 9 \nGlasses Type 10 \nNext Page","Open","Close");
        return 1;
    }
    if (strcmp("/removeglasses",cmdtext,true, 10) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
        return 1;
    }
    return 0;
}
Reply
#8

Quote:
Originally Posted by Jafet_Macario
Посмотреть сообщение
already tried...cant understand clearly with it :/
Reply
#9

Quote:
Originally Posted by Josma_cmd
Посмотреть сообщение
pawn Код:
{
    if (strcmp("/buyglasses", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,25,DIALOG_STYLE_LIST,"Glasses","Glasses Type 1 \nGlasses Type 2 \nGlasses Type 3 \nGlasses Type 4 \nGlasses Type 5 \nGlasses Type 6 \nGlasses Type 7 \nGlasses Type 8 \nGlasses Type 9 \nGlasses Type 10 \nNext Page","Open","Close");
        return 1;
    }
    if (strcmp("/removeglasses",cmdtext,true, 10) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
        return 1;
    }
    return 1;
}
Replace to

pawn Код:
{
    if (strcmp("/buyglasses", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,25,DIALOG_STYLE_LIST,"Glasses","Glasses Type 1 \nGlasses Type 2 \nGlasses Type 3 \nGlasses Type 4 \nGlasses Type 5 \nGlasses Type 6 \nGlasses Type 7 \nGlasses Type 8 \nGlasses Type 9 \nGlasses Type 10 \nNext Page","Open","Close");
        return 1;
    }
    if (strcmp("/removeglasses",cmdtext,true, 10) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
        return 1;
    }
    return 0;
}
Still getting same problem
Reply
#10

Here
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buyglasses", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,25,DIALOG_STYLE_LIST,"Glasses","Glasses Type 1 \nGlasses Type 2 \nGlasses Type 3 \nGlasses Type 4 \nGlasses Type 5 \nGlasses Type 6 \nGlasses Type 7 \nGlasses Type 8 \nGlasses Type 9 \nGlasses Type 10 \nNext Page","Open","Close");
        return 1;
    }
    if (strcmp("/removeglasses",cmdtext,true, 10) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
        return 1;
    }
    return 0;
}
There is the full OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)