/lock Help(rep)
#2

i useing this Code:
pawn Код:
if (strcmp(cmdtext, "/lock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_GREY,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            SendClientMessage(playerid, COLOR_GREY, "Vehicle locked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1056,pX,pY,pZ);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
        }
        return 1;
    }
AND UNLOCK

pawn Код:
if (strcmp(cmdtext, "/unlock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid)){
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER){
                SendClientMessage(playerid, COLOR_GREY,"You can only unlock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++){
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            SendClientMessage(playerid, COLOR_GREY, "Vehicle unlocked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1057,pX,pY,pZ);
        }else{
            SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
        }
        return 1;
    }
Btw +rep
Reply


Messages In This Thread
/lock Help(rep) - by Dan_Barocu - 20.01.2012, 18:49
Re: /lock Help(rep) - by James Coral - 20.01.2012, 18:53

Forum Jump:


Users browsing this thread: 1 Guest(s)