07.03.2013, 15:22
Well, if the player parks his car while its locked, and relogs he won't be able to unlock/lock it again somehow, except if he gets into it, of course it's impossible since its locked.
here's the command:
here's the command:
Код:
if(strcmp(cmd, "/lock", true) == 0) { if(IsPlayerConnected(playerid)) { new oldcar = gLastCar[playerid]; new Float:cx, Float:cy, Float:cz; GetVehiclePos(oldcar, cx, cy, cz); if(IsPlayerInRangeOfPoint(playerid, 4, cx, cy, cz)) { if(gVehicleLock[playerid] != 1) { SendClientMessage(playerid, COLOR_GREY, " You don't have a lock for this vehicle !"); return 1; } if(IsABike(oldcar) || IsABoat(oldcar) || IsAPlane(oldcar) || IsAHelicopter(oldcar) || IsATrain(oldcar)) { SendClientMessage(playerid, COLOR_GREY, " You can't lock that type of vehicle !"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); if(gCarLock[oldcar] == 1) { PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger has unlocked their vehicle."); else format(string, sizeof(string), "* %s has unlocked their vehicle.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); UnLockCar(oldcar); } else { if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger has locked their vehicle."); else format(string, sizeof(string), "* %s has locked their vehicle.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); LockCar(oldcar); } } else { SendClientMessage(playerid, COLOR_GREY, " You are too far away from your vehicle!"); return 1; } } return 1; }