cmd problem
#1

heres my command:

pawn Код:
dcmd_veh(playerid,params[])
{
    #pragma unused params
    new String[200];
    new tmp[256];
    new Float:x, Float:y, Float:z;
    new vehicle = GetVehicleModelIDFromName(tmp);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE : /vehicle [Vehicle name]");
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, COLOR_RED, "ERROR : That vehicle name was not found");
    new 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 PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
    LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    PutPlayerInVehicle(playerid, PlayersVehicle, 0);
    format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
    SendClientMessage(playerid, COLOR_LIGHTGREEN, String);
    return 1;
}
except, it either doesnt spawn a car, or unknown command appears.

ive edited it loads of times to try to get it to work, but it doesnt :/

any help plox?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)