22.11.2010, 19:18
pawn Код:
if(strcmp(cmd, "/carlock", true) ==0)
{
if(GetClosestVehicle(playerid, 5))
{
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(!strcmp(CarSystem[GetClosestVehicle(playerid,5)][Carowner], pName(playerid), true))
{
if(CarLock[GetClosestVehicle(playerid,5)] == 0)
{
CarLock[GetClosestVehicle(playerid,5)] = 1;
SetVehicleParamsForPlayer(GetClosestVehicle(playerid,5),p,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),p,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;
}