[SOLVED] Lock/Unlock
#3

I hope this code will work for you...Paste this inside OnPlayerCommandText

pawn Код:
if(!strcmp(cmdtext,"/lock",true,5)) {
      new carid;
        if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
          GameTextForPlayer(playerid,"~r~LOCKED !",1000,1);
        carid=GetPlayerVehicleID(playerid);
        new i;
        for (i=0;i<MAX_PLAYERS;i++){
            if (i!=playerid) SetVehicleParamsForPlayer(carid,i,0,1);
        }
        return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_ERROR, "ERROR : You need to be in a vehicle that you want to be unlocked.");
          return 1;
        }

    }

    if(!strcmp(cmdtext,"/unlock",true,7)) {
      new carid;
        if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
        carid=GetPlayerVehicleID(playerid);
            GameTextForPlayer(playerid,"~g~UNLOCKED !",1000,1);
        new i;
        for (i=0;i<MAX_PLAYERS;i++){
            if (i!=playerid) SetVehicleParamsForPlayer(carid,i,0,0);
        }
        return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_ERROR, "ERROR : You need to be in a vehicle as a driver that you want to be unlocked.");
          return 1;
        }
    }
Reply


Messages In This Thread
[SOLVED] Lock/Unlock - by BP13 - 25.07.2009, 04:35
Re: Lock/Unlock - by evilmidget95 - 25.07.2009, 04:36
Re: Lock/Unlock - by abhinavdabral - 25.07.2009, 05:18
Re: Lock/Unlock - by BP13 - 25.07.2009, 05:28
Re: Lock/Unlock - by abhinavdabral - 25.07.2009, 05:35
Re: Lock/Unlock - by BP13 - 25.07.2009, 05:39
Re: [SOLVED] Lock/Unlock - by abhinavdabral - 25.07.2009, 05:59

Forum Jump:


Users browsing this thread: 1 Guest(s)