[Help]: Last Step On Script Help!
#1

hello all i have made lock unlock commands!

pawn Код:
if(strcmp(cmd, "/lock", true)==0)
        {
        if(IsPlayerInAnyVehicle(playerid))
                {
            new State=GetPlayerState(playerid);
            if  (State!=PLAYER_STATE_DRIVER)
                {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
                }
            lockedCar[GetPlayerVehicleID(playerid)]=1;
            new i;
                for (i=0;i<MAX_PLAYERS;i++)
                    {
                        if(i != playerid)
                        {
                        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                        }
                    }
                SendClientMessage(playerid, COLOR_YELLOW, "Vehicle locked!");
                new Float:pX, Float:pY, Float:pZ;
                GetPlayerPos(playerid,pX,pY,pZ);
                PlayerPlaySound(playerid,1056,pX,pY,pZ);
                }
        else
            {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
            }
        return 1;
        }
pawn Код:
if(strcmp(cmd, "/unlock", true)==0)
       {
       if(IsPlayerInAnyVehicle(playerid))
            {
            new State=GetPlayerState(playerid);
            if  (State!=PLAYER_STATE_DRIVER)
                {
                SendClientMessage(playerid,COLOR_RED,"You can only unlock the doors as the driver.");
                return 1;
                }
            new i;
            lockedCar[GetPlayerVehicleID(playerid)]=0;
            for (i=0;i<MAX_PLAYERS;i++)
                {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
                }
            SendClientMessage(playerid, COLOR_YELLOW, "Vehicle unlocked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1057,pX,pY,pZ);
            }
        else
            {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
            }
        return 1;
        }
now what i need i done from it it's all work no problems but when i use lock command i tell me
Vehicle Locked But other players can steal it from me and enter it like what they want how i can let them no enter my car while im locked it! thanks hope you will help me guys!
Reply


Messages In This Thread
[Help]: Last Step On Script Help! - by [MKD]Max - 29.03.2011, 20:30
Re: [Help]: Last Step On Script Help! - by [NRP]Blade - 29.03.2011, 20:32
Re: [Help]: Last Step On Script Help! - by [MKD]Max - 29.03.2011, 20:38
Re: [Help]: Last Step On Script Help! - by [MKD]Max - 29.03.2011, 20:47
Re: [Help]: Last Step On Script Help! - by SchurmanCQC - 29.03.2011, 20:49
Re: [Help]: Last Step On Script Help! - by [NRP]Blade - 29.03.2011, 20:50
Re: [Help]: Last Step On Script Help! - by [MKD]Max - 29.03.2011, 21:10
Re: [Help]: Last Step On Script Help! - by Vince - 29.03.2011, 21:27

Forum Jump:


Users browsing this thread: 1 Guest(s)