Vehicle ID
#1

pawn Код:
CMD:createveh(playerid, params[])
{
    new
        vehid,colorid1,colorid2;
    new
        Float:x,Float:y,Float:z;
    if (sscanf(params, "iii", vehid, colorid1, colorid2)) SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /createveh [Vehicle ID] [Color 1 ID] [Color 2 ID]");
    else if (vehid== INVALID_VEHICLE_ID) SendClientMessage(playerid, 0xFF0000AA, "Invalid Vehicle ID");// needs Fix
    else
    {
        GetPlayerPos(playerid, x, y, z);
        CreateVehicle(vehid, x+1, y+1, z, 0, colorid1, colorid2, 1);
        SetVehicleParamsEx(??, 0, 0, 0, 0, 0, 0, 0);
    }
    return 1;
}
what should I type instead of the "??" in SetVehicleParamsEx, I want it to apply thoses status on the vehicle created using /createveh
and what's meant by objective (last param in SetVehicleParamEx
thanks
Reply
#2

vehid instead of the Plus you have some errors in these code, put returns before sendclientmessage
Reply
#3

actually I'm not getting any errors and it works fine in all cases(if I delete the setvehicleparamsex)
++ vehid = the Vehicle model ID not the vehicle ID
Reply
#4

No it doesn't work fine, it will send the sscanf message all the time it's not in brackets or anything.
I am on phone wish if I am on PC to correct it for you.
About veh id, create a new new for example new carid; and near the creating do carid = createvehicle(....) and use carid at setvehicleparamsex
Reply
#5

alright +rep for the vehid solution, about the code it works fine , I tested it 1000 times (I'm a beginner anyway, I'll add returns but it works fine, really)
Reply
#6

At an advanced stage you will listen to me and add returns
Reply
#7

Try this, it's not tested:

Код:
CMD:createveh(playerid, params[])
{
	new vid, col1, col2;
	if(sscanf(params, "iii", vid, col1, col2)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /createveh [Vehicle ID] [Color 1 ID] [Color 2 ID]");
	if(400 < (vid) > 611) return SendClientMessage(playerid, 0xFFFFFFFF, "INVALID VEHICLE ID!");
	else
	{
		new Float:pos[3], car;
		GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		car = CreateVehicle(vid, pos[0]+1.0, pos[1]+1.0, pos[2], 0.0, col1, col2, 0);
		SetVehicleParamsEx(car, 0, 0, 0, 0, 0, 0, 0);
	}
	return 1;
}
Reply
#8

That's what I exactly told her at an earlier stage.
Reply
#9

Quote:
Originally Posted by Stanford
Посмотреть сообщение
vehid instead of the ?? Plus you have some errors in these code, put returns before sendclientmessage
SetVehicleParamsEx will set parameteres for vehicleid, NOT for modelid, as you written it in this post.
Reply
#10

Quote:
Originally Posted by dirigent00
Посмотреть сообщение
SetVehicleParamsEx will set parameteres for vehicleid, NOT for modelid, as you written it in this post.
Yes he corrected it, If you check the next reply he gave me the right answer!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)