Need a vehicle lock system that..
#1

hey yo guys!,

could you help me.. i need a lock system that if player near the vehicle that ISN'T his and he tries to get in by pressing the 'ENTER' or 'F' (standard)

it will just ignore the vehicle and don't even try to get in..

i hope you know what I'm saying.. thank you.
Reply
#2

In OnPlayerEnterVehicle callback put this:
pawn Код:
if(/*Something...*/) {}
else { //You can't enter the vehicle
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz); }
Reply
#3

Try this

pawn Код:
new Frozen[MAX_PLAYERS];
forward Freeze();

public OnPlayerConnect(playerid)
{
    Frozen[playerid] = 0;
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(ispassenger) return 0;

    if(vehicleid == WHATEVER)
    {
        new PlayerName[MAX_PLAYER_NAME] = GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
        if(!strcmp(PlayerName, "YouName", true))
        {
            SetTimer("Freeze",5,false); TogglePlayerControllable(playerid, 0);
            Frozen[playerid] = 1;
        } else return 0;
    }
    return 1;
}

public Freeze()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(Frozen[i] == 1)
      {
        TogglePlayerControllable(i, 1);
        SendClientMessage(i, 0xFFFFFFAA,"  You are not the owner of this vehicle!");
      }
    }
    return 1;
}
Reply
#4

thank you ill try it now..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)