Need help with command [REP+++]
#1

Hey guys, I've a little problem with a command createcdveh, it means create a dealership vehicle.
I can't make more than 10 vehicles somehow, can anyone help with the command?

This is it:
Код:
CMD:createcdveh(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] < 1337)
	{
        SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
        return 1;
    }

    new string[128], price, dealershipid, modelid;
    if(sscanf(params, "ddd", price, dealershipid, modelid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /createcdveh [price] [dealership] [modelid]");

    new Float:X,Float:Y,Float:Z,Float:A;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid, A);
    new cdvehicleid = CreateCarDealershipVehicle(dealershipid, modelid, X, Y, Z, A, price);
    if(cdvehicleid == -1)
	{
        SendClientMessageEx(playerid, COLOR_GREY, "ERROR: cdVehicles limit reached.");
    }
    else
	{
        format(string, sizeof(string), " SYSTEM: Car dealership vehicle created (M-ID %d)(ID %d)", modelid, cdvehicleid);
        SendClientMessageEx(playerid, COLOR_GRAD1, string);
    }
    return 1;
}
Reply
#2

Do you have a define or variable for this? if so then increase it, it would probably look like
pawn Код:
#define MAX_VEHICLES 10

new veh[10];
Reply
#3

Show me CreateCarDealershipVehicle.
Reply
#4

Код:
  modelid = strval(inputtext);
	             if(modelid < 400 || modelid > 611) { SendClientMessageEx(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
	             new cdvehicleid = CreateCarDealershipVehicle(d, modelid, x, y, z, a, 1337);
	             if(cdvehicleid == -1)
Or this

Код:
stock CreateCarDealershipVehicle(dealershipid, modelid, Float: x, Float: y, Float: z, Float: a, price)
{
    new cdvehicleid = GetFreeCarDealershipVehicleId(dealershipid);
    if(cdvehicleid == -1) return -1;
    new text_info[128];
    CarDealershipInfo[dealershipid][cdVehicleModel][cdvehicleid] = modelid;
    CarDealershipInfo[dealershipid][cdVehicleCost][cdvehicleid] = price;
    CarDealershipInfo[dealershipid][cdVehicleSpawnX][cdvehicleid] = x;
    CarDealershipInfo[dealershipid][cdVehicleSpawnY][cdvehicleid] = y;
    CarDealershipInfo[dealershipid][cdVehicleSpawnZ][cdvehicleid] = z;
    CarDealershipInfo[dealershipid][cdVehicleSpawnAngle][cdvehicleid] = a;
    new carcreated = AddStaticVehicleEx(modelid, x, y, z, a, 0, 0, 6);
    format(text_info, sizeof(text_info), "%s For Sale\nPrice: %d\nID: %d", GetVehicleName(carcreated), CarDealershipInfo[dealershipid][cdVehicleCost][cdvehicleid], cdvehicleid);
    CarDealershipInfo[dealershipid][cdVehicleLabel][cdvehicleid] = CreateDynamic3DTextLabel(text_info,COLOR_LIGHTBLUE,0.0, 0.0, 0.0,5.0,INVALID_PLAYER_ID,carcreated,1);
	CarDealershipInfo[dealershipid][cdVehicleId][cdvehicleid] = carcreated;
	SavecDealership(cdvehicleid);
    return cdvehicleid;
Reply
#5

Quote:
Originally Posted by Voxel
Посмотреть сообщение
Do you have a define or variable for this? if so then increase it, it would probably look like
pawn Код:
#define MAX_VEHICLES 10

new veh[10];
thanks mate, +rep

<PROBLEM SOLVED>
Reply
#6

BUMP, -

Now I get another problem.
When i try to create more than 10 vehicles, at defines. i changed it to 100.
but when i try to create the 11th vehicle, it says unknown command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)