01.08.2010, 09:42
So, I've gotten stuck on this problem with the /carlock command. For some reason it won't detect that I'm the owner of the vehicle even if I am and leads to that I can't lock it even if I own it.
Код:
if(strcmp(cmd, "/carlock", true) ==0)
{
if(GetClosestVehicle(playerid, 5))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (strmatch(CarSystem[GetClosestVehicle(playerid,5)][Carowner],pName(playerid)))
{
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;
}
}
}
return 1;
}


