Código PHP:
CMD:car(playerid, params[])
{
static
model[32],
color1,
color2;
if(sscanf(params, "s[25]dd", model, color1, color2))
return SendClientMessage(playerid, -1, "* /car [modelo id/nome] [cor 1(opcional)] [cor 2(opcional)]");
if((model[0] = GetVehicleModelByName(model)) == 0)
return SendClientMessage(playerid, -1, "* ID de modelo inválido.");
static
Float:x, Float:y, Float:z, Float:a, vehicle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
vehicle = CreateVehicle(model[0], x, y, z, a, color1, color2, 0);
PutPlayerInVehicle(playerid, vehicle, 0);
SetVehicleVirtualWorld(vehicle, GetPlayerVirtualWorld(playerid)); // adicione isso
return 1;
}
isso setará o veiculo no mundo que o playerid esta