all commands in my GM and FS's including Npc record script returning ERROR UNKNOWN COMMAND
#1

well ever since i added a few commands to my GM and updated to 0.3d RC6 all my commands are returning SERVER ERROR: Unknown command here is my GM note this is a 0.3d RC6 script
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx;
    new cmd[256];
   
    cmd = strtok(cmdtext, idx);

    if(strcmp("/SpawnTunedSultan1", cmdtext, true) == 0)
    {
        GetPlayerPos(playerid, X,Y,Z);
        SetVehiclePos(Tuned_Sultan1, X,Y,Z);
        SendClientMessage(playerid,COLOR_GRAD2,"Sultan Spawned");
        new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
        new string[128]; // Creating the string.
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
        format(string, sizeof(string), "%s has Spawned The Tuned Sultan!!",pName); // This is what will send to everyone!
        SendClientMessageToAll(COLOR_GRAD2, string);
        return 1;
    }
    if(strcmp("/SpawnTunedSultan2", cmdtext, true) == 0)
    {
        GetPlayerPos(playerid, X,Y,Z);
        SetVehiclePos(Tuned_Sultan2, X,Y,Z);
        SendClientMessage(playerid,COLOR_GRAD2,"Sultan Spawned");
        new pName[MAX_PLAYER_NAME]; // Saying pName is the Players Name!
        new string[128]; // Creating the string.
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME); // tells the pName to get the players name!
        format(string, sizeof(string), "%s has Spawned The Tuned Sultan!!",pName); // This is what will send to everyone!
        SendClientMessageToAll(COLOR_GRAD2, string);
        return 1;
    }
    if(strcmp("/Spawn_Assistance_Car", cmdtext, true) == 0)
    {
        TogglePlayerControllable(playerid, 0);
        ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "What is it that you want?", "Shamal \nDodo \nSultan \nInfernus", "Select", "Cancel");
        return 1;
    }
    if(strcmp("/Rules", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "Server Rules Abide By These Rules Or Be Punished", "1)NO Hacking of anysort this included S0biet and Mods that make it look like you Are Hacking \n2)NO ramming \n3)Respect The Server Owner and the admins \n4)Dont Interupt in players doin Missions \nFAILURE TO ABIDE BY THESE RULES WILL BE PUNISHED", "Agree", "Decline");
        return 1;
    }
    if(!strcmp("/repair", cmdtext))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
    if(strcmp("/Elevator_Controls", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Please Choose the floor for the elevator to goto", "Ground Floor \nFloor 1 \nTop Floor", "Select", "Cancel");
        return 1;
    }
    if(strcmp("/Start_Curcits", cmdtext, true) == 0)
    {
        IsPlayerTimeTraveling[playerid] = true;
        return 1;
    }
    if(strcmp("/Stop_Curcits", cmdtext, true) == 0)
    {
        IsPlayerTimeTraveling[playerid] = false;
        return 1;
    }
    if(strcmp("/Enter_Del", cmdtext, true) == 0)
    {
        PutPlayerInVehicle(playerid, Delorian[0], 0);
        return 1;
    }
    if(strcmp("/UP", cmdtext, true) == 0)
    {
        /*
        CreateDynamicObject(1383, -54.31, 1509.23, 39.88,   0.00, 0.00, 0.00);
        MainLift = CreateDynamicObject(18755, -55.06, 1512.60, 63.50,   0.00, 0.00, 180.00);
        CreateDynamicObject(1383, -58.41, 1511.68, 39.88,   0.00, 0.00, 0.00);
        CreateDynamicObject(1383, -56.52, 1509.23, 39.88,   0.00, 0.00, 0.00);
        CreateDynamicObject(1383, -58.40, 1509.26, 39.88,   0.00, 0.00, 0.00);
        CreateDynamicObject(1383, -58.41, 1513.98, 39.88,   0.00, 0.00, 0.00);
        CreateDynamicObject(1383, -54.19, 1515.96, 39.88,   0.00, 0.00, 0.00);
        CreateDynamicObject(1383, -56.49, 1515.97, 39.88,   0.00, 0.00, 0.00);
        CreateDynamicObject(1383, -58.43, 1515.99, 39.88,   0.00, 0.00, 0.00);
        Moving_Sliders[0] = CreateDynamicObject(2633, -50.91, 1513.41, 59.97,   0.00, 0.00, 0.00);
        Moving_Sliders[1] = CreateDynamicObject(2633, -50.88, 1511.73, 59.97,   0.00, 0.00, 180.00);
        Moving_Sliders[2] = CreateDynamicObject(2633, -46.72, 1511.74, 59.97,   0.00, 0.00, 180.00);
        Moving_Sliders[3] = CreateDynamicObject(2633, -46.75, 1513.43, 59.97,   0.00, 0.00, 0.00);
        // CreateDynamicObject(18755, -55.06, 1512.60, 13.76,   0.00, 0.00, 180.00);
        Rocket = CreateDynamicObject(9958, -41.90, 1518.71, 58.59,   270.00, 0.00, 0.00);
        Booster_Set1[0] = CreateDynamicObject(17051, -38.50, 1511.89, 3.54,   0.00, 0.00, 0.00);
        Booster_Set1[1] = CreateDynamicObject(17051, -45.13, 1511.92, 3.54,   0.00, 0.00, 0.00);
        Booster_Set1[2] = CreateDynamicObject(17051, -44.08, 1509.49, 3.54,   0.00, 0.00, 0.00);
        Booster_Set1[3] = CreateDynamicObject(17051, -40.89, 1509.65, 3.54,   0.00, 0.00, 0.00);
        Booster_Set1[4] = CreateDynamicObject(17051, -39.90, 1514.75, 3.54,   0.00, 0.00, 0.00);
        Booster_Set2[0] = CreateDynamicObject(17051, -44.05, 1514.62, 71.83,   0.00, 0.00, 0.00);
        Booster_Set1[5] = CreateDynamicObject(17051, -43.23, 1514.72, 3.54,   0.00, 0.00, 0.00);
        Booster_Set2[1] = CreateDynamicObject(17051, -39.34, 1515.22, 71.83,   0.00, 0.00, 180.00);
        Docking_Pod = CreateDynamicObject(17051, -41.70, 1512.77, 57.45,   0.00, 0.00, 24.71);
        Booster_Set2[2] = CreateDynamicObject(17051, -41.96, 1517.88, 69.40,   0.00, 0.00, 188.45);
        */

        MoveDynamicObject(MainLift, -55.06, 1512.60, 13.76, 1);
        return 1;
    }
    if(strcmp("/DOWN", cmdtext, true) == 0)
    {
        MoveDynamicObject(MainLift, -55.06, 1512.60, 63.50, 1);
        return 1;
    }
    if(strcmp("/Prepare", cmdtext, true) == 0)
    {
        SetTimer("Ten", 1000, 0);
        SetTimer("Nine", 2000, 0);
        SetTimer("Eight", 3000, 0);
        SetTimer("Seven", 4000, 0);
        SetTimer("Six", 5000, 0);
        SetTimer("Five", 6000, 0);
        SetTimer("Four", 7000, 0);
        SetTimer("Three", 8000, 0);
        SetTimer("Two", 9000, 0);
        SetTimer("One", 10000, 0);
        SetTimer("Liftoff", 11000, 0);
        SCM(playerid, Red, "Countdown Initiated 10 Seconds Untill Liftoff");
        MoveDynamicObject(Moving_Sliders[2], -50.8800, 1511.7300, 59.9700, 1);
        MoveDynamicObject(Moving_Sliders[3], -50.9100, 1513.4100, 59.9700, 1);
        SpectateDynamicObject(playerid, Docking_Pod);
        return 1;
    }
    if(strcmp("/RetroBurners_Initiate", cmdtext, true) == 0)
    {
        new Float:RotX,Float:RotY,Float:RotZ;
        new Float:x, Float:y, Float:z;
        new string[128];
        new string1[128];
        new string2[128];
        new string3[128];
        GetDynamicObjectRot(Docking_Port, RotX, RotY, RotZ);
        GetDynamicObjectPos(Docking_Port, x, y, z);
        format(string, sizeof(string),"Current Status Of ISS Docking Port:");
        format(string1, sizeof(string1),"Rotational Axis: %f %f %f", RotX, RotY, RotZ);
        format(string2, sizeof(string2),"Location: %f %f %f", x, y ,z);
        format(string3, sizeof(string3),"Lining Up For Docking Now type /dock to dock with the ISS :)");
        SendClientMessage(playerid, Yellow, string);
        SendClientMessage(playerid, Yellow, string1);
        SendClientMessage(playerid, Yellow, string2);
        SendClientMessage(playerid, Yellow, string3);
        RotateDynamicObject(Docking_Port, RotX, RotY, 0.0, 90, 1);
        return 1;
    }
    if(strcmp("/Retrieve_ISS_Co-Ordinates", cmdtext, true) == 0)
    {
        new Float:RotX,Float:RotY,Float:RotZ;
        new Float:x, Float:y, Float:z;
        new string[128];
        new string1[128];
        new string2[128];
        GetDynamicObjectRot(Docking_Port, RotX, RotY, RotZ);
        GetDynamicObjectPos(Docking_Port, x, y, z);
        format(string, sizeof(string),"Current Status Of ISS Docking Port:");
        format(string1, sizeof(string1),"Rotational Axis: %f, %f, %f", RotX, RotY, RotZ);
        format(string2, sizeof(string2),"Location: %f, %f, %f", x, y ,z);
        SendClientMessage(playerid, Yellow, string);
        SendClientMessage(playerid, Yellow, string1);
        SendClientMessage(playerid, Yellow, string2);
        return 1;
    }
    if(strcmp("/Dock", cmdtext, true) == 0)
    {
        new Float:x, Float:y, Float:z;
        GetDynamicObjectPos(Docking_Port, x, y, z);
        new string[128];
        format(string, sizeof(string),"Engines Powering up, Heading For the Current Location of the ISS docking Port which is %f %f %f", x, y, z);
        SendClientMessage(playerid, Yellow, string);
        MoveDynamicObject(Docking_Pod, x, y, z, 5);
        return 1;
    }
    if(strcmp("/SpecISS", cmdtext, true) == 0)
    {
        SpectateDynamicObject(playerid, Docking_Port);
        return 1;
    }
    if(strcmp("/StopSpec", cmdtext, true) == 0)
    {
        StopSpectate(playerid);
        return 1;
    }
    if(strcmp(cmdtext, "/tazer", true) ==0 || strcmp(cmdtext, "/ta", true) ==0)
    {
    // We make it again for TEAM_COPS
        if(gTeam[playerid] == POLICE)// For cops
        {
            if(IsPlayerInAnyVehicle(playerid)) // Checks if the player is in a vehicle.
            {
                SendClientMessage(playerid, 0xFF0000FF, "You can't use this command while in a car!");
                return 1;
            }
            if(pTazer[playerid] == 0) // If the player has no tazer withdrawn.
            {
                GivePlayerWeapon(playerid, 23, 20); // Gives a SD.
                pTazer[playerid] = 1; // Sets the var to true.
                return 1;
            }
            else if(pTazer[playerid] == 1) // If the player has the tazer withdrawn to holster it.
            {
                GivePlayerWeapon(playerid, 24, 100); // Gives a deagle.
                pTazer[playerid] = 0; // Sets the var to false.
                return 1;
            }
        }// Not a cop.
        else SendClientMessage(playerid, Red, "SERVER:Unknown Command");
        return 1;
    }
    if(strcmp(cmdtext, "/Enter1", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2144.32, 1626.21, 992.97))
        {
            SetPlayerPos(playerid, 2144.25, 1627.88, 992.97);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter2", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2195.8352, 1677.8108, 11.3594))
        {
            SetPlayerPos(playerid, 2233.38, 1713.37, 1011.04);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter3", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2233.38, 1713.37, 1011.04))
        {
            SetPlayerPos(playerid, 2195.8352, 1677.8108, 11.3594);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter4", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2192.3313, 1751.4857, 9.7734))
        {
            SetPlayerPos(playerid, 2203.3345, 1552.0974, 1008.0000);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter5", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2203.3345, 1552.0974, 1008.0000))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                new VID = GetPlayerVehicleID(playerid);
                LinkVehicleToInterior(VID, 1);
                SetVehiclePos(VID, 2192.3313, 1751.4857, 9.7734);
            }
            else SetPlayerPos(playerid, 2192.3313, 1751.4857, 9.7734);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter6", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2192.6790, 1585.0559, 1000.0170))
        {
            MoveDynamicObject(Door1, 2195.8391, 1584.9993, 993.6932, 1);
            MoveDynamicObject(Door2, 2195.8391, 1584.9993, 993.6932, 1);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter7", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2207.1016, 1584.8506, 1000.0170))
        {
            MoveDynamicObject(Door1, 2195.84, 1585.00, 999.50, 1);
            MoveDynamicObject(Door2, 2195.84, 1585.00, 1001.45, 1);
            MoveDynamicObject(Door1, 2214.8726, 1584.9539, 993.1107, 1);
            MoveDynamicObject(Door2, 2214.8726, 1584.9539, 993.1107, 1);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter8", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2218.5513, 1585.2219, 1000.0170))
        {
            MoveDynamicObject(Door3, 2214.87, 1584.95, 999.40, 1);
            MoveDynamicObject(Door4, 2214.87, 1584.95, 1001.45, 1);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Enter9", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 2148.0054, 1605.2368, 1005.5469))
        {
            SetPlayerPos(playerid, 2147.8625, 1603.8025, 1005.5469);
        }
        return 1;
    }
    return 0;
}
i have no errors nothin but when i go ingame and type one commands or the NPC record script commands it returns the error unknown command message

the only warnnigs i have are to do with JunkBuster include here they are
Код:
C:\Documents and Settings\Rhys\Desktop\samp03dsvr_RC6_win32\pawno\include\JunkBuster.inc(358) : warning 201: redefinition of constant/macro (symbol "SetPlayerHealth")
C:\Documents and Settings\Rhys\Desktop\samp03dsvr_RC6_win32\pawno\include\JunkBuster.inc(365) : warning 201: redefinition of constant/macro (symbol "SetPlayerArmour")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
pls help me
Reply
#2

if(strcmp"/SpawnTunedSultan2",cmdtext,true, 6) == 0)
in ever command put "6"
PHP код:
if(strcmp"/SpawnTunedSultan2",cmdtext,true6) == 0// put 6 
Reply
#3

i dont need 2 it worked FINE before i updated to 0.3d RC6
Reply
#4

try to use zcmd or ycmd or dcmd
its a lot easier...
Reply
#5

ye i find it wierd Dcmd commands work but strcmp ones dont O.o
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)