help with this cmd
#1

pawn Код:
CMD:spawnveh(playerid, params[])
{
    new id, Float:pos[4], col[2];
    new inputtext[40];
    new modelid = strval(inputtext);
    if(sscanf(params, "ii", modelid, col[0], col[1])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehicleid] [color1] [color2]");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"You are not in any vehicle to whom you want to change");
    new vehicleid = GetPlayerVehicleID(playerid);
    DestroyVehicle(vehicleid);
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    vipcar = CreateVehicle(modelid, pos[0], pos[1], pos[2], pos[3], col[0], col[1], 1200);
    PutPlayerInVehicle(playerid,vipcar,1);
    //format(string, sizeof(string), "AdmWarn: %s has spawned a vehicle model %d.", RPN(playerid), id);
    //SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}
This cmd works properly, but this cmd doesnt spawns the vehicle.. that is the problem only, overall it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)