What's wrong with this line?
#12

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I am editing your code now, but I see no use for these functions;

pawn Код:
if(GetClosestVehicle(playerid, 5))
    {
        for(new p = 0; p < MAX_PLAYERS; p++)
        {
EDIT: This seems to be the better option, you were allowing any player to enter the vehicle when you should of been allowing only the vehicle's owner to enter the vehicle. I removed some functions.

pawn Код:
if(strcmp(cmd, "/carlock", true) ==0)
{
    new str[128];
    new vehicleid = GetClosestVehicle(playerid, 5);
    if(!strcmp(CarSystem[vehicleid][Carowner], pName(playerid), true))
    {
        if(CarLock[vehicleid] == 0)
        {
            CarLock[vehicleid] = 1;
            SetVehicleParamsForPlayer(vehicleid, playerid, 0, 1);
            format(str, sizeof(str), "* %s presses a key which locks the doors of the vehicle", pName(playerid));
            ProxDetector(30.0, playerid, str, MECHAT, MECHAT, MECHAT, MECHAT, MECHAT);
        }
        else if(CarLock[vehicleid] == 1)
        {
            CarLock[vehicleid] = 0;
            SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
            format(str, sizeof(str), "* %s presses a key which unlocks the doors of the vehicle", pName(playerid));
            ProxDetector(30.0, playerid, str, MECHAT, MECHAT, MECHAT, MECHAT, MECHAT);
        }
    }
    return 1;
}
Uuh, still I am able to unlock and lock all vehicles I can find even if I'm not the owner.
Reply


Messages In This Thread
What's wrong with this line? - by Mystique - 22.11.2010, 13:02
Re: What's wrong with this line? - by Flyfishes - 22.11.2010, 13:06
Re: What's wrong with this line? - by Mystique - 22.11.2010, 13:13
Re: What's wrong with this line? - by Lenny the Cup - 22.11.2010, 14:02
Re: What's wrong with this line? - by Scenario - 22.11.2010, 14:04
Re: What's wrong with this line? - by Mystique - 22.11.2010, 16:44
Re: What's wrong with this line? - by Scenario - 22.11.2010, 16:49
Re: What's wrong with this line? - by XePloiT - 22.11.2010, 17:16
Re: What's wrong with this line? - by Mystique - 22.11.2010, 19:18
Re: What's wrong with this line? - by Scenario - 22.11.2010, 19:28
Re: What's wrong with this line? - by armyoftwo - 22.11.2010, 19:30
Re: What's wrong with this line? - by Mystique - 22.11.2010, 19:41
Re: What's wrong with this line? - by Scenario - 22.11.2010, 19:54
Re: What's wrong with this line? - by Mystique - 22.11.2010, 20:00
Re: What's wrong with this line? - by XePloiT - 22.11.2010, 20:09
Re: What's wrong with this line? - by Mystique - 22.11.2010, 20:13

Forum Jump:


Users browsing this thread: 3 Guest(s)