Help with OnVehicleStreamIn
#4

This is my /carlock command.
pawn Код:
if(strcmp(cmd, "/carlock", true) ==0)
    {
     if(GetClosestVehicle(playerid, 5))
     {
      for(new i = 0; i < MAX_PLAYERS; i++)
      {
       if(strmatch(CarSystem[GetCreatorID(vehicleid)][Carowner],pName(playerid)))
       {
        if(CarLock[GetClosestVehicle(playerid,5)] == 0)
        {
        CarLock[GetClosestVehicle(playerid,5)] = 1;
        SetVehicleParamsForPlayer(GetClosestVehicle(playerid,5),i,0,1);
        new str[128];
        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);
        return 1;
        }
        else if(CarLock[GetClosestVehicle(playerid,5)] == 1)
        {
        CarLock[GetClosestVehicle(playerid,5)] = 0;
        SetVehicleParamsForPlayer(GetClosestVehicle(playerid,5),i,0,0);
        new str[128];
        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;
        }
       }

      }
     }
     return 1;
     }

And this is my OnVehicleStreamIn:

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    for(new i = 0;i<MAX_CARS;i++)
    {
    SetVehicleParamsForPlayer(i, forplayerid, 0, CarLock[i]);
    }
    return 1;
}
Reply


Messages In This Thread
Help with OnVehicleStreamIn - by Mystique - 14.08.2010, 11:04
Re: Help with OnVehicleStreamIn - by [HUN]Jaki - 14.08.2010, 11:35
Re: Help with OnVehicleStreamIn - by ikey07 - 14.08.2010, 11:36
Re: Help with OnVehicleStreamIn - by Mystique - 14.08.2010, 11:38
Re: Help with OnVehicleStreamIn - by [HUN]Jaki - 14.08.2010, 11:41

Forum Jump:


Users browsing this thread: 1 Guest(s)