28.01.2013, 10:59
Hello! I got a problem i kinda need help with, long story short its when u /lock you car, it sends the message it is locked, but you still can enter it, so does everyone else. Doesn't matter if you are admin or not.
All kinds of help is very much appreciated.
HERE IS THE /LOCK CODE:
HERE IS THE CODE, WHAT SHOULD HAPPEN, BUT DOESN'T:
All kinds of help is very much appreciated.
HERE IS THE /LOCK CODE:
Код:
new key; if(ForwardOwnCar(1,playerid)) { key = PlayerInfo[playerid][pCarkey]; } else if(ForwardOwnCar(2,playerid)) { key = PlayerInfo[playerid][pCarkey2]; } else if(ForwardOwnCar(3,playerid)) { key = PlayerInfo[playerid][pCarkey3]; } else { return 1; } if(CarInfo[key][cLock] == 0) { CarInfo[key][cLock] = 0; format(string, sizeof(string), "~p~%s~n~~g~UNLOCKED",CarInfo[key][cDescription]); GameTextForPlayer(playerid, string, 7000, 4); SaveCars(); return 1; } else if(CarInfo[key][cLock] == 1) { CarInfo[key][cLock] = 1; format(string, sizeof(string), "~g~%s~n~~r~LOCKED",CarInfo[key][cDescription]); GameTextForPlayer(playerid, string, 7000, 4); SaveCars(); return 1;
Код:
if(IsAnOwnableCar(vehicleid) && CarInfo[VehicleOwned[vehicleid]][cLock] != 1) { if(AdminDuty[playerid] == 0) { ApplyAnimationEx(playerid, "ped", "CAR_doorlocked_LHS", 3.0, 0, 0, 0, 0, 0); SetVehicleParamsForPlayer(vehicleid,playerid,0,1); new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz); DOO_SetPlayerPos(playerid, cx, cy, cz); SendClientMessage(playerid,COLOR_LIGHTRED,"[ERROR] This vehicle is currently locked!"); LockCar[playerid][0] = 3; LockCar[playerid][1] = vehicleid; ApplyAnimationEx(playerid, "ped", "CAR_doorlocked_LHS", 3.0, 0, 0, 0, 0, 0); } } } return 1; }