Unknown Command
#1

pawn Код:
CMD:vcreate(playerid, vehicleid, params[])
{
   
    new
        Float:Pos[4],
        ivModel,
        ivPrice,
        ivColors[2],
        Query[256],
        iMsg[148];
    GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
    GetVehicleZAngle(vehicleid, Pos[3]);
    ivModel = GetPlayerVehicleID(playerid);
    //if(sscanf(params, "iiii", ivModel, ivPrice, ivColors[0], ivColors[1])) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/VCreate < Vehicle Model > < Price > < Color 1 > < Color 2 >");

    Created++;

    vInfo[Created][vModel]  = ivModel;
    vInfo[Created][vColor1] = 2;
    vInfo[Created][vColor2] = 2;
    vInfo[Created][vPrice]  = 1000;
    vInfo[Created][vPosX]   = Pos[0];
    vInfo[Created][vPosY]   = Pos[1];
    vInfo[Created][vPosZ]   = Pos[2];
    vInfo[Created][vPosA]   = Pos[3];
    strmid(vInfo[Created][vOwner], "Unbought", 0, 20, 20);
    strmid(vInfo[Created][vPlate], "ChangeME", 0, 32, 32);

    format(Query, sizeof(Query), "INSERT INTO `privateveh` (`vID`, `vModel`, `vColor1`, `vColor2`, `vPrice`, `vOwner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `vPlate`) VALUES (%d, %d, %d, %d, %d, 'Unbought', %f, %f, %f, %f, 'ChangeME')",
    Created,
    ivModel,
    ivColors[0],
    ivColors[1],
    ivPrice,
    Pos[0],
    Pos[1],
    Pos[2],
    Pos[3]);
    mysql_query(Query);

    new
        cCar = CreateVehicle(ivModel, Pos[0], Pos[1], Pos[2], Pos[3], ivColors[0], ivColors[1], 500000);
    SetVehicleNumberPlate(cCar, "ChangeME");

    ivCreated[cCar] = Created;

    SavePrivVeh(Created);

    format(iMsg, sizeof(iMsg), ""#CYELLOW"Vehicle: "#CBLUE"%i (VID: %i) "#CYELLOW"has been created. Price: "#CBLUE"$%i "#CYELLOW"Plate: "#CBLUE"ChangeME", ivModel, Created, ivPrice);
    SendClientMessage(playerid, -1, iMsg);
    return 1;
}
Shows unknown command, i tried FS then put it in GM but wont work.i have zcmd
Reply
#2

The header for zcmd is CMD:vcreate(playerid, params[]) and not CMD:vcreate(playerid, vehicleid, params[])
Reply
#3

i need that otherwise it says undefined vehicleid
Reply
#4

Try This..

Код:
CMD:vcreate(playerid, params[])
{
    
    new
        Float:Pos[4],
        ivModel,
        ivPrice,
        ivColors[2],
        Query[256],
        iMsg[148];
    ivModel = GetPlayerVehicleID(playerid);
    GetVehiclePos(ivModel , Pos[0], Pos[1], Pos[2]);
    GetVehicleZAngle(ivModel , Pos[3]);
    //if(sscanf(params, "iiii", ivModel, ivPrice, ivColors[0], ivColors[1])) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/VCreate < Vehicle Model > < Price > < Color 1 > < Color 2 >");

    Created++;

    vInfo[Created][vModel]  = ivModel;
    vInfo[Created][vColor1] = 2;
    vInfo[Created][vColor2] = 2;
    vInfo[Created][vPrice]  = 1000;
    vInfo[Created][vPosX]   = Pos[0];
    vInfo[Created][vPosY]   = Pos[1];
    vInfo[Created][vPosZ]   = Pos[2];
    vInfo[Created][vPosA]   = Pos[3];
    strmid(vInfo[Created][vOwner], "Unbought", 0, 20, 20);
    strmid(vInfo[Created][vPlate], "ChangeME", 0, 32, 32);

    format(Query, sizeof(Query), "INSERT INTO `privateveh` (`vID`, `vModel`, `vColor1`, `vColor2`, `vPrice`, `vOwner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `vPlate`) VALUES (%d, %d, %d, %d, %d, 'Unbought', %f, %f, %f, %f, 'ChangeME')",
    Created,
    ivModel,
    ivColors[0],
    ivColors[1],
    ivPrice,
    Pos[0],
    Pos[1],
    Pos[2],
    Pos[3]);
    mysql_query(Query);

    new
        cCar = CreateVehicle(ivModel, Pos[0], Pos[1], Pos[2], Pos[3], ivColors[0], ivColors[1], 500000);
    SetVehicleNumberPlate(cCar, "ChangeME");

    ivCreated[cCar] = Created;

    SavePrivVeh(Created);

    format(iMsg, sizeof(iMsg), ""#CYELLOW"Vehicle: "#CBLUE"%i (VID: %i) "#CYELLOW"has been created. Price: "#CBLUE"$%i "#CYELLOW"Plate: "#CBLUE"ChangeME", ivModel, Created, ivPrice);
    SendClientMessage(playerid, -1, iMsg);
    return 1;
}
Reply
#5

That wont work anyway, that gets the vehicle model ID not the vehicleid.
Reply
#6

That only gets the vehicleid and not the model id.
GetPlayerVehicleID

To get the model:
GetVehicleModel
Reply
#7

Opps, that means i need to change to this:
ivModel = GetPlayerVehicleID(playerid);
to this
ivMdel = GetVehicleModel
Which means again, i still need to add vehicleid to the zcmd
Reply
#8

BUMP I STILL NEED HELP!
I managed to edit it, and when i typed /vcreate it created, but i check SQL database and all the Floats are 0 instead of the coords.Also, after that i cant type vcreate again, it shows unknown command.It only worked once.HELP PLEASE
Reply
#9

pawn Код:
new
        Float:Pos[4],
        ivModel,
        ivPrice,
        ivColors[2],
        Query[256],
        iMsg[148];
        ivID,
    ivModel = GetVehicleModel(playerid);
    ivID = GetPlayerVehicleID(playerid);
Reply
#10

Okay I found out it was actually creating from my FS, so i removed my FS.I'm back to problem 1.It shows unknown command WHY THE FUCK!?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)