/veh with name instead of id.
#5

pawn Код:
YCMD:veh(playerid, params[], help)
{
    if(help) return SCM(playerid, COLOR_GREY, "Not supported");
   
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        new veh_name[32], iColor[2];
        if(sscanf(params,"s[32]ii",veh_name, iColor[0],iColor[1])) return SCM(playerid, COLOR_GRAD, "USAGE: /veh [vehicle name] [color1] [color2]");
        new model = GetVehicleModelIDFromName(veh_name);
        if(model == -1) return SCM(playerid, COLOR_GREY, "Invalid vehicle name");
        if(iColor[1] < 0 && iColor[1] > 126) return SCM(playerid, COLOR_GREY, "Invalid color ID.");
        new vid, Float:x, Float:y, Float:z, Float:angle, engine,lights,alarm,doors,bonnet,boot,objective;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, angle);
        vid = CreateVehicle(model, x, y, z, angle, iColor[0], iColor[1], -1);
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
        engineOn[vid] = true;
        SetVehicleNumberPlate(vid, "ADMIN");
        PutPlayerInVehicle(playerid, vid, 0);
    }
    return 1;
}
Reply


Messages In This Thread
/veh with name instead of id. - by whando - 05.04.2014, 11:34
Re: /veh with name instead of id. - by Konstantinos - 05.04.2014, 11:39
Re: /veh with name instead of id. - by CroM256 - 05.04.2014, 11:46
Re: /veh with name instead of id. - by whando - 05.04.2014, 11:48
Re: /veh with name instead of id. - by Konstantinos - 05.04.2014, 11:52
Re: /veh with name instead of id. - by RajatPawar - 05.04.2014, 12:45
Re: /veh with name instead of id. - by Konstantinos - 05.04.2014, 12:49

Forum Jump:


Users browsing this thread: 1 Guest(s)