[Tutorial] Locking Vehicles - Custom Way
#6

Quote:
Originally Posted by Tuntun
Посмотреть сообщение
Код:
#include <a_samp>
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(LockedCar[vehicleid] == 1 && PlayerCar[playerid] != vehicleid) 
    {
        if(MsgLocked[playerid] == 1) 
        {
            TextDrawHideForPlayer(playerid, Locked); 
            MsgLocked[playerid] = 0;
            KillTimer(LockedTimer[playerid]); 
        }
        TogglePlayerControllable(playerid, true); 
        Locked = TextDrawCreate(10.0, 250.0, "This Vehicle is Locked"); 
        TextDrawUseBox(Locked, 1);
        TextDrawBoxColor(Locked, 0x00000055);
        TextDrawTextSize(Locked, 125, 5);
        TextDrawShowForPlayer(playerid, Locked); /
        LockedTimer[playerid] = SetTimer("RemoveLock", 4000, false);
        MsgLocked[playerid] = 1; 
    }
    return 1;
}

public RemoveLock(playerid)
{
    if(MsgLocked[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, Locked); 
        MsgLocked[playerid] = 0; 
    }
}

public OnVehicleSpawn(vehicleid)
{
    LockedCar[vehicleid] = 0; 
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerCar[i] == vehicleid)
            PlayerCar[i] = -1; 
    }
    return 0;
}
ofc, you didn't declare global variable or commands, this is not whole code, next time read whole tutorial :P I'll update it with whole code at the end, give me 2 min
Reply


Messages In This Thread
Locking Vehicles - Custom Way - by SEnergy - 28.07.2012, 15:45
Re: Locking Vehicles - Custom Way - by CoDeZ - 28.07.2012, 15:49
Re: Locking Vehicles - Custom Way - by Tuntun - 28.07.2012, 16:59
Re: Locking Vehicles - Custom Way - by SEnergy - 28.07.2012, 17:04
Re: Locking Vehicles - Custom Way - by Tuntun - 28.07.2012, 17:16
Re: Locking Vehicles - Custom Way - by SEnergy - 28.07.2012, 17:17
Re: Locking Vehicles - Custom Way - by Tuntun - 28.07.2012, 17:33
Re: Locking Vehicles - Custom Way - by SomebodyAndMe - 28.07.2012, 17:45
Re: Locking Vehicles - Custom Way - by SEnergy - 28.07.2012, 18:01
Re: Locking Vehicles - Custom Way - by Jakku - 28.07.2012, 18:26

Forum Jump:


Users browsing this thread: 2 Guest(s)