Vehicle for specific player
#10

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
// global
new gVehicleOwner[MAX_VEHICLES + 1] = {INVALID_PLAYER_ID, ...};

new vehicleid = CreateVehicle(411,0,0,0,2,-1,-1,3600);
gVehicleOwner[vehicleid] = playerid;

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

    if(gVehicleOwner[vehicleid] != INVALID_PLAYER_ID)
        if(gVehicleOwner[vehicleid] != playerid)
        {
            new string[64];
            GetPlayerName(gVehicleOwner[vehicleid], string, MAX_PLAYER_NAME);
            format(string, sizeof(string), "This car is owned by %s", string);
            SendClientMessage(playerid, -1, string);
            ClearAnimations(playerid);
        }

    return 1;
}
and for destroy

Change all DestroyVehicle to DestroyVehicleEx

pawn Код:
DestroyVehicleEx(vehicleid)
{
    if(!(0 < vehicleid < sizeof(gVehicleOwner))) return 0;
    gVehicleOwner[vehicleid] = INVALID_PLAYER_ID;
    return DestroyVehicle(vehicleid);
}
I want to destroy vehicle when player disconnects. How do I do that?
Reply


Messages In This Thread
Vehicle for specific player - by Supermaxultraswag - 14.09.2015, 17:04
AW: Vehicle for specific player - by Nero_3D - 14.09.2015, 18:43
Re : Vehicle for specific player - by KillerDVX - 14.09.2015, 22:38
Re: Vehicle for specific player - by Supermaxultraswag - 18.09.2015, 15:25
Re: Vehicle for specific player - by Mister0 - 18.09.2015, 15:30
Re: Vehicle for specific player - by Supermaxultraswag - 18.09.2015, 15:33
Re: Vehicle for specific player - by Mister0 - 18.09.2015, 15:45
Re: Vehicle for specific player - by rappy93 - 18.09.2015, 15:46
Re: Vehicle for specific player - by Jefff - 18.09.2015, 15:47
Re: Vehicle for specific player - by Supermaxultraswag - 03.10.2015, 12:47

Forum Jump:


Users browsing this thread: 2 Guest(s)