Unknown Command
#1

pawn Код:
command(movecar, playerid, params[])
{
    new carid = GetPlayerVehicleID(playerid), query[500];
    if(AdminLoggedIn[playerid] == 1 && Player[playerid][Adminlevel] >= 6)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
       
            GetVehiclePos(carid, Vehicles[carid][VPosX], Vehicles[carid][VPosY], Vehicles[carid][VPosZ]);
            GetVehicleZAngle(carid, Vehicles[carid][VPosAngle]);
            format(query, sizeof(query), "UPDATE `Vehicles` SET `VPosX` = '%f', `VPosY` = '%f', `VPosZ` = '%f', `VPosAngle` = '%f' WHERE `VehicleID` = %d",
                Vehicles[carid][VPosX],
                Vehicles[carid][VPosY],
                Vehicles[carid][VPosZ],
                Vehicles[carid][VPosAngle],
                carid);
            mysql_function_query(connectionHandle, query, false, "DefaultCallback", "");
           
            DestroyVehicle(carid);
           
            Vehicles[carid][VehicleID] = AddStaticVehicleEx(Vehicles[carid][ModelID], Vehicles[carid][VPosX], Vehicles[carid][VPosY], Vehicles[carid][VPosZ], Vehicles[carid][VPosAngle], Vehicles[carid][Color1], Vehicles[carid][Color2], -1);
            SetVehicleVirtualWorld(Vehicles[carid][VehicleID], Vehicles[carid][VehicleWorld]);//set vw
            LinkVehicleToInterior(Vehicles[carid][VehicleID], Vehicles[carid][VehicleInteriorID]);//set int
            SetVehicleNumberPlate(Vehicles[carid][VehicleID], Vehicles[carid][VPlate]);
            new query2[500];
            format(query2, sizeof(query2), "UPDATE `Vehicles` SET `VehicleID` = %d WHERE `CarFileID` = %d", Vehicles[carid][VehicleID], carid);
            mysql_function_query(connectionHandle, query2, false, "DefaultCallback", "");
       
            SCM(playerid, GREEN, "You have succesfully moved this car");
        }
    }
    else
    {
        TextDrawShowForPlayer(playerid, Text:CantCommand);
        SetTimerEx("RemoveCantCommand", 3500, false, "d", playerid);
    }
    return 1;
}
My Server keeps saying server unknown command.

Whats wrong?
Reply
#2

Well, this could only mean one thing, and that is that there is a problem in the code somewhere (that pawn isn't finding when you compile); the problem is where's the problem...

I skimmed your code over and didn't see the issue so to help you find the area with the problem, try doing this type of thing (the more of these you have the better you will be in finding the problem):

pawn Код:
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 1: Admin is logged in");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 2: Player is in a vehicle");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 3: Vehicle Move Started");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 4: Vehicle Deleted");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 5: Vehicle Recreated");
So, when you see (for example):
Checkpoint 1: Admin is logged in
Checkpoint 2: Player is in a vehicle
[Server]: Unknown Command!

You will know that the problem is before Checkpoint 3 and after checkpoint 2...

Hope this helps you find the issue!
Reply
#3

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
Well, this could only mean one thing, and that is that there is a problem in the code somewhere (that pawn isn't finding when you compile); the problem is where's the problem...

I skimmed your code over and didn't see the issue so to help you find the area with the problem, try doing this type of thing (the more of these you have the better you will be in finding the problem):

pawn Код:
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 1: Admin is logged in");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 2: Player is in a vehicle");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 3: Vehicle Move Started");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 4: Vehicle Deleted");
SendClientMessage(playerid, COLOR_GREEN, "Checkpoint 5: Vehicle Recreated");
So, when you see (for example):
Checkpoint 1: Admin is logged in
Checkpoint 2: Player is in a vehicle
[Server]: Unknown Command!

You will know that the problem is before Checkpoint 3 and after checkpoint 2...

Hope this helps you find the issue!
Thanks mate', found the problem, REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)