Need help with destroying unwanted Veh
#2

CMD:

pawn Код:
CMD:veh(playerid, params[])
{
    if(GetAdminLevel(playerid) >= 2) {
        new car;
        if(IsPlayerInAnyVehicle(playerid)) return 1;
        if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehid]");
        if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "Invalid model id!");
        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x,y,z);
        GetPlayerFacingAngle(playerid, a);
        car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
        PutPlayerInVehicle(playerid, car, 0);
        SetPVarInt(playerid, "AdminVeh", car);
    }
    return 1;
}

Add inside PlayerExitVehicle public

pawn Код:
if(vehicleid == GetPVarInt(playerid, "AdminVeh"))
{
    DestroyVehicle(vehicleid);
    DeletePVar(playerid, "AdminVeh");
    SendClientMessage(playerid, -1, "You have left your admin vehicle and it has been destroyed.");
}
Reply


Messages In This Thread
Need help with destroying unwanted Veh - by Goldilox - 19.04.2013, 13:20
Re: Need help with destroying unwanted Veh - by PaulDinam - 19.04.2013, 13:42
Re: Need help with destroying unwanted Veh - by Goldilox - 19.04.2013, 21:33
Re: Need help with destroying unwanted Veh - by bensmart469 - 19.04.2013, 21:57
Re: Need help with destroying unwanted Veh - by Goldilox - 20.04.2013, 00:42

Forum Jump:


Users browsing this thread: 3 Guest(s)