pawn Code:
dcmd_veh(playerid,params[])
{
new vehid = GetVehicleModelIDFromName(tmp);
if(sscanf(params,"d",vehid)) {
SendClientMessage(playerid,GREEN,"[USAGE] /veh [VEHID]");
}
else if(vehid < 400 || vehid > 611) {
SendClientMessage(playerid,RED,"[ERROR] VehicleID can't be below 400 or above 611 or false name given.");
}
else {
new Float:x, Float:y, Float:z, Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1) {
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else {
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new i = GetPlayerInterior(playerid);
new v = CreateVehicle(vehid, x, y, z, a+90, -1, -1, 0);
LinkVehicleToInterior(v, i);
new string[100];
format(string, sizeof(string), "Car with id %s has been spawned", aVehicleNames[vehid - 400]);
SendClientMessage(playerid, GREEN, string);
}
return 1;
}
It doesn't work.. Error at line: