Problem with command. Only returns Server: Unknown Command
#1

Hello, I've been scripting for a while now I guess, and have never had this problem before. I've had this problem with ALL my commands at once, but not on a single one alone.

To me this command looks just fine, but maybe you guys could help me a bit?

pawn Code:
if(strcmp(cmd, "/asellcar", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] > 5)
        {
            new vehid;
            vehid = GetPlayerVehicleID(playerid);
            new CarQuery[100];
            new OwnerName[MAX_PLAYER_NAME];
            OwnerName = CarInfo[vehid][cOwner];
            new Owner = ReturnUser(OwnerName);
            new Value = CarInfo[vehid][cValue];
            if(gPlayerLogged[Owner] != 0)
            {
                PlayerInfo[Owner][pPcarkey] = 999;
                PlayerInfo[Owner][pAccount] += CarInfo[vehid][cValue];
                SendClientMessage(Owner, COLOR_INFO, "* Your vehicle was sold by and admin. Your money has been wired to your bank account.");
            }
            else
            {
                format(CarQuery, sizeof(CarQuery), "UPDATE `Players` SET `Car`=999, `Bank`=%d WHERE `Name`=`%s`", PlayerInfo[Owner][pAccount] + Value, CarInfo[vehid][cOwner]);
                mysql_query(CarQuery);
            }
            CarInfo[vehid][cOwned] = 0;
            strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~w~You have admin sold the vehicle", 10000, 3);
            CarInfo[vehid][cLocationx] = CarInfo[vehid][cSellLocationx];
            CarInfo[vehid][cLocationy] = CarInfo[vehid][cSellLocationy];
            CarInfo[vehid][cLocationz] = CarInfo[vehid][cSellLocationz];
            CarInfo[vehid][cAngle] = CarInfo[vehid][cSellAngle];
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
            SaveCars(vehid, 2);
            DestroyVehicle(vehid);
            CreateVehicle(CarInfo[vehid][cModel], CarInfo[vehid][cLocationx], CarInfo[vehid][cLocationy], CarInfo[vehid][cLocationz]+1.0, CarInfo[vehid][cAngle], CarInfo[vehid][cColorOne], CarInfo[vehid][cColorTwo], 60000);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "* You are not authorized to use that command.");
        }
        return 1;
    }
Reply
#2

all the commands dont work? or some?
Reply
#3

Could easily be a MySQL error. I see a problem with your query:

Code:
WHERE `Name`=`%s`
It should be

Code:
WHERE `Name`='%s'
Reply
#4

Quote:
Originally Posted by coole210
View Post
Could easily be a MySQL error. I see a problem with your query:

Code:
WHERE `Name`=`%s`
It should be

Code:
WHERE `Name`='%s'
you are right but he has also problem here the command didnt success. (it tells him Server: Unknown Command.)
Reply
#5

Quote:
Originally Posted by kirollos
View Post
you are right but he has also problem here the command didnt success. (it tells him Server: Unknown Command.)
If the mysql query is incorrect, it can either crash the whole server or in commands it often just sends SERVER: Unknown Command.
Reply
#6

Just a minor mistake, but that is not the reason it returns SERVER: Unknown command.
If there is an error in the query, it will show up in the debug

But the command looks fine, doesn't it?

All my other commands work, at least I think they do. I haven't had any trouble using other commands.
Reply
#7

can you try use on a command prossesor ? (like ZCMD) ?

and let's see if it will work or not?
Reply
#8

I would prefer not to, I'm going to convert all my commands to ZCMD in due time, but not right now Haven't really studied up on it, so not sure how to do it either.
Reply
#9

bump
Reply
#10

Removed
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)