SA-MP Forums Archive
Problem SERVER Unknown Cmd - 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: Problem SERVER Unknown Cmd (/showthread.php?tid=445490)



Problem SERVER Unknown Cmd - erorche - 21.06.2013

What is the problem of the command the command isn't bugged but shows Server: Unknown Command. only in the house commands like /buyhouse /sellhouse /setrentable /rentroom etc.
Please help people

Some Pictures:



Command:
pawn Код:
if(strcmp(cmd, "/open", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
                {
                    if(PlayerInfo[playerid][pHousekey] == i)
                    {
                        if(HouseInfo[i][hLock] == 1)
                        {
                            HouseInfo[i][hLock] = 0;
                            GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(HousePickup[i]);
                            DestroyDynamic3DTextLabel(HouseLabel[i]);
                            OnPropTextdrawUpdate(2, i);
                            return 1;
                        }
                        if(HouseInfo[i][hLock] == 0)
                        {
                            HouseInfo[i][hLock] = 1;
                            GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            DestroyDynamicPickup(HousePickup[i]);
                            DestroyDynamic3DTextLabel(HouseLabel[i]);
                            OnPropTextdrawUpdate(2, i);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(BizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]) || PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i)
                    {
                        if(BizzInfo[i][bLocked] == 1)
                        {
                            BizzInfo[i][bLocked] = 0;
                            GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(BusinessPickup[i]);
                            DestroyDynamic3DTextLabel(BusinessLabel[i]);
                            OnPropTextdrawUpdate(1, i);
                            return 1;
                        }
                        if(BizzInfo[i][bLocked] == 0)
                        {
                            BizzInfo[i][bLocked] = 1;
                            GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(BusinessPickup[i]);
                            DestroyDynamic3DTextLabel(BusinessLabel[i]);
                            OnPropTextdrawUpdate(1, i);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i+100)
                    {
                        if(SBizzInfo[i][sbLocked] == 1)
                        {
                            SBizzInfo[i][sbLocked] = 0;
                            GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            return 1;
                        }
                        if(SBizzInfo[i][sbLocked] == 0)
                        {
                            SBizzInfo[i][sbLocked] = 1;
                            GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }



Respuesta: Problem SERVER Unknown Cmd - Parka - 21.06.2013

OnPlayerCommandText

return 1;


Re: Problem SERVER Unknown Cmd - erorche - 21.06.2013

its return 1; :@


Re: Problem SERVER Unknown Cmd - IceBilizard - 21.06.2013

try this one

pawn Код:
if(!strcmp(cmd, "/open", true))
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
                {
                    if(PlayerInfo[playerid][pHousekey] == i)
                    {
                        if(HouseInfo[i][hLock] == 1)
                        {
                            HouseInfo[i][hLock] = 0;
                            GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(HousePickup[i]);
                            DestroyDynamic3DTextLabel(HouseLabel[i]);
                            OnPropTextdrawUpdate(2, i);
                            return 1;
                        }
                        if(HouseInfo[i][hLock] == 0)
                        {
                            HouseInfo[i][hLock] = 1;
                            GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            DestroyDynamicPickup(HousePickup[i]);
                            DestroyDynamic3DTextLabel(HouseLabel[i]);
                            OnPropTextdrawUpdate(2, i);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(BizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]) || PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i)
                    {
                        if(BizzInfo[i][bLocked] == 1)
                        {
                            BizzInfo[i][bLocked] = 0;
                            GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(BusinessPickup[i]);
                            DestroyDynamic3DTextLabel(BusinessLabel[i]);
                            OnPropTextdrawUpdate(1, i);
                            return 1;
                        }
                        if(BizzInfo[i][bLocked] == 0)
                        {
                            BizzInfo[i][bLocked] = 1;
                            GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(BusinessPickup[i]);
                            DestroyDynamic3DTextLabel(BusinessLabel[i]);
                            OnPropTextdrawUpdate(1, i);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i+100)
                    {
                        if(SBizzInfo[i][sbLocked] == 1)
                        {
                            SBizzInfo[i][sbLocked] = 0;
                            GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            return 1;
                        }
                        if(SBizzInfo[i][sbLocked] == 0)
                        {
                            SBizzInfo[i][sbLocked] = 1;
                            GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }



Re: Problem SERVER Unknown Cmd - erorche - 21.06.2013

ISNT WORKING OMGG :@ WHAT IS THE PROBLEM, Add me on skype erorche please, i will give you the gamemode if you have time


Re: Problem SERVER Unknown Cmd - IceBilizard - 21.06.2013

Wait did you have zcmd if have then use CMD: format its awesome first of all do on top of script

pawn Код:
#include <zcmd>

then use
pawn Код:
CMD:open(playerid, params[])
    {
        #pragma unused params
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
                {
                    if(PlayerInfo[playerid][pHousekey] == i)
                    {
                        if(HouseInfo[i][hLock] == 1)
                        {
                            HouseInfo[i][hLock] = 0;
                            GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(HousePickup[i]);
                            DestroyDynamic3DTextLabel(HouseLabel[i]);
                            OnPropTextdrawUpdate(2, i);
                            return 1;
                        }
                        if(HouseInfo[i][hLock] == 0)
                        {
                            HouseInfo[i][hLock] = 1;
                            GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            DestroyDynamicPickup(HousePickup[i]);
                            DestroyDynamic3DTextLabel(HouseLabel[i]);
                            OnPropTextdrawUpdate(2, i);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(BizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]) || PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i)
                    {
                        if(BizzInfo[i][bLocked] == 1)
                        {
                            BizzInfo[i][bLocked] = 0;
                            GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(BusinessPickup[i]);
                            DestroyDynamic3DTextLabel(BusinessLabel[i]);
                            OnPropTextdrawUpdate(1, i);
                            return 1;
                        }
                        if(BizzInfo[i][bLocked] == 0)
                        {
                            BizzInfo[i][bLocked] = 1;
                            GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            OnPropUpdate();
                            DestroyDynamicPickup(BusinessPickup[i]);
                            DestroyDynamic3DTextLabel(BusinessLabel[i]);
                            OnPropTextdrawUpdate(1, i);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i+100)
                    {
                        if(SBizzInfo[i][sbLocked] == 1)
                        {
                            SBizzInfo[i][sbLocked] = 0;
                            GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            return 1;
                        }
                        if(SBizzInfo[i][sbLocked] == 0)
                        {
                            SBizzInfo[i][sbLocked] = 1;
                            GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
try this if works then ok else add me shehrozassad ok skype


Re: Problem SERVER Unknown Cmd - erorche - 21.06.2013

i found the problem the problem is this...
pawn Код:
OnPropUpdate(); // for updating mysql
DestroyDynamicPickup(HousePickup[i]); //destroying the pickup
DestroyDynamic3DTextLabel(HouseLabel[i]); // destroying the old 3dtext
OnPropTextdrawUpdate(2, i);//updating new text ----> i think this is the problem