/lock Command dont work..
#9

I made this command to check if i was near my second car it would say a message.. Where would i put this in the lock command to make it say it if im near the second vehicle if i type /lock

Command

pawn Code:
command(lol, playerid, params[])
{
    #pragma unused params
    if(Player[playerid][PlayerCarModel2] > 0)
    {
        if(IsPlayerInRangeOfVehicle(playerid, Player[playerid][Car2LinkID], 10))
        {
            if(Player[playerid][Car2LinkID] > 0)
                {
                    SendClientMessage(playerid, WHITE, "Yes you are near your vehicle");
                }
        }
    }
}
pawn Code:
command(lock, playerid, params[])
{
    #pragma unused params
    new engine, lights, alarm, doors, bonnet, boot, objective, string[128];
    if(Player[playerid][PlayerCarModel] > 0)
    {
        if(IsPlayerInRangeOfVehicle(playerid, Player[playerid][CarLinkID], 10))
        {
            if(Player[playerid][CarLinkID] > 0)
                {
                    if(Player[playerid][LockedCar] == 0)
                        {
                            Player[playerid][LockedCar] = 1;
                            format(string, sizeof(string), "%s has locked their vehicle", GetName(playerid));
                            NearByMessage(playerid, PURPLE, string);

                            for(new i = 0; i < MAX_PLAYERS; i++)
                            {
                                if(i != playerid)
                                {
                                    GetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, doors, bonnet, boot, objective);
                                    SetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, 1, bonnet, boot, 0);
                                }
                            }
                            return 1;
                        }
                        else
                        {
                            Player[playerid][LockedCar] = 0;
                            format(string, sizeof(string),"%s has unlocked their vehicle", GetName(playerid));
                            NearByMessage(playerid, PURPLE, string);

                            for(new i = 0; i < MAX_PLAYERS; i++)
                            {
                                GetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, doors, bonnet, boot, objective);
                                SetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, 0, bonnet, boot, 0);
                               
                            }
                        }
                }
                else
                {
                    SendClientMessage(playerid, WHITE, "You do not own a car");
                }
        }
        else
        {
            SendClientMessage(playerid, WHITE, "You are not near any of your vehicles");
        }
    }
    return 1;
}
If you help me i will appreciate it
Reply


Messages In This Thread
/lock Command dont work.. - by Geniuss - 01.06.2012, 15:51
Re: /lock Command dont work.. - by Sandiel - 01.06.2012, 16:17
Re: /lock Command dont work.. - by Geniuss - 01.06.2012, 16:20
Re: /lock Command dont work.. - by teomakedonija - 01.06.2012, 16:22
Re: /lock Command dont work.. - by Sandiel - 01.06.2012, 16:25
Re: /lock Command dont work.. - by Geniuss - 01.06.2012, 16:25
Re: /lock Command dont work.. - by Geniuss - 01.06.2012, 16:29
Re: /lock Command dont work.. - by Geniuss - 01.06.2012, 16:54
Re: /lock Command dont work.. - by Geniuss - 01.06.2012, 18:14

Forum Jump:


Users browsing this thread: 1 Guest(s)