10.01.2013, 18:59
hi Guyz i need help i stuck in 1 prob in revans script /v lock is not working
i want to make it like when i /v lock my car then no 1 can enter in it doors will ge locked can any one code it for me just putting a code of /v lock
In Forward
In new
enum cInfo
if u dont understand then plz add me on skype then ill give u script skype is : asfand.shah3
i want to make it like when i /v lock my car then no 1 can enter in it doors will ge locked can any one code it for me just putting a code of /v lock
In Forward
Код:
forward LockCar(carid); forward UnLockCar(carid); forward InitLockDoors(playerid);
Код:
new gCarLock[265];
Код:
cLock,
Код:
LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp) { gPlayerUsingLoopingAnim[playerid] = 1; ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp); TextDrawShowForPlayer(playerid,txtAnimHelper); }
Код:
OnePlayAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp) { if (gPlayerUsingLoopingAnim[playerid] == 1) TextDrawHideForPlayer(playerid,txtAnimHelper); ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp); animation[playerid]++; }
Код:
if(IsAnOwnableCar(newcar)) { if(PlayerInfo[playerid][pPcarkey] == newcar) { CanTurnEngine[playerid] = newcar; } else if(PlayerInfo[playerid][pPcarkey2] == newcar) { CanTurnEngine[playerid] = newcar; } else { if(PlayerInfo[playerid][pAdmin] >= 5 && PlayerInfo[playerid][pAdminDuty] == 1) { SendClientMessage(playerid, COLOR_GREY, " You can drive this car because you are admin on duty !"); } else { if(CarInfo[newcar][cLock] == 1) { CanTurnEngine[playerid] = 9999; TogglePlayerControllable(playerid, 0); if(PlayerInfo[playerid][pDecoder] == 1) { SendClientMessage(playerid, COLOR_GREY, "You can use your decoder with /decode"); } } else { SendClientMessage(playerid, COLOR_GREY,"* Car is not locked so you can start the engine!"); CanTurnEngine[playerid] = newcar; } } } if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Ownable Car"); }
Код:
public LockCar(carid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetVehicleParamsForPlayer(carid,i,1,1); } } } public UnLockCar(carid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(!IsAPlane(carid)) { SetVehicleParamsForPlayer(carid,i,0,0); } } } } public InitLockDoors(playerid) { if(IsPlayerConnected(playerid)) { new c; while (c < 254) { c++; if (gCarLock[c] == 1) { SetVehicleParamsForPlayer(c,playerid,0,1); } } } return 1; }
Код:
else if(strcmp(x_nr,"lock",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey]; if(keycar != 9999) { new Float:X,Float:Y,Float:Z; GetVehiclePos(keycar,X,Y,Z); if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z)) { new locked[128]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(4,keycar); return 1; } else if(CarInfo[keycar][cLock] == 0) { format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(4,keycar); return 1; } } else { SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "* You don't have a vehicle at slot 1"); return 1; } } else if(strcmp(x_nr,"lock2",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey2]; if(keycar != 9999) { new Float:X,Float:Y,Float:Z; GetVehiclePos(keycar,X,Y,Z); if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z)) { new locked[128]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(4,keycar); return 1; } else if(CarInfo[keycar][cLock] == 0) { format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(4,keycar); return 1; } } else { SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2"); return 1; } }