22.03.2011, 06:37
ok, refresh my memory how to add getvehiclenameformid to this command, had a car wreck and forgot some shit.
PHP код:
CMD:v(playerid, params[])
{
new v1, color1,color2, idx;
idx = GetVehicleModelIDFromName(v1);
if (sscanf(params,"iii",v1, color1,color2))
{
return SendClientMessage(playerid, -1, "Syntax: /v <vehicle ID>, color1, color2");
}
if ( getveh[playerid] > 0 )
{
DestroyVehicle(getveh[playerid]);
getveh[playerid] = 0;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
getveh[playerid] = CreateVehicle(v1, x, y, z, 90, color1, color2, false);
PutPlayerInVehicle(playerid, getveh[playerid], 0);
}else{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
getveh[playerid] = CreateVehicle(v1, x, y, z, 90, color1, color2, false);
PutPlayerInVehicle(playerid, getveh[playerid], 0);
}
return 1;
}