Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:lock(playerid, params[])
- {
- if(TextResetCMD[playerid] > gettime()) return SendClientMessage(playerid, COLOR_GREY, "Не флуди");
- new Float:x, Float:y, Float:z, type = 1;
- if(sscanf(params, "i", type)) type = 1;
- else if(type > 2 || type < 1) type = 1;
- new carid;
- if(PI[playerid][PlayerCarID] && type == 1) carid = PI[playerid][PlayerCarID];
- else if(PI[playerid][pVehicleKey] && type == 2) carid = PI[playerid][pVehicleKey];
- else if(type == 2)
- {
- if(GetPVarInt(playerid, "arendkey") == -1) return SendClientMessage(playerid, COLOR_GREY, "Вы не арендуете транспорт");
- new rc = GetPVarInt(playerid, "arendkey");
- if(ArendInfo[rc][aPlayerID] != playerid)
- {
- SendClientMessage(playerid, COLOR_GREY, "Вы не арендуете транспорт");
- SetPVarInt(playerid, "arendkey", -1);
- return 1;
- }
- GetVehiclePos(ArendInfo[rc][aID], x, y, z);
- if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "Вы должны находиться возле арендованного Вами транспорта!");
- if(VehicleInfo[ArendInfo[rc][aID]-1][vLock] == 0)
- {
- CarDoorsEx(ArendInfo[rc][aID], 1);
- GameTextForPlayer(playerid, "~r~locked", 2000, 3);
- PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
- MeAction(playerid, "достал ключи и закрыл транспорт");
- }
- else
- {
- CarDoorsEx(ArendInfo[rc][aID], 0);
- GameTextForPlayer(playerid, "~g~unlocked", 2000, 3);
- PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
- MeAction(playerid, "достал ключи и открыл транспорт");
- }
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_GREY, "У вас нет авто!");
- GetVehiclePos(carid, x, y, z);
- if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "Вы должны находиться возле своего транспорта!");
- if(VehicleInfo[carid-1][vLock] == 0)
- {
- PI[playerid][cLock] = 1;
- CarDoors(carid, PI[playerid][cLock]);
- GameTextForPlayer(playerid, "~r~locked", 2000, 3);
- PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
- MeAction(playerid, "достал ключи и закрыл транспорт");
- }
- else
- {
- PI[playerid][cLock] = 0;
- CarDoors(carid, PI[playerid][cLock]);
- GameTextForPlayer(playerid, "~g~unlocked", 2000, 3);
- PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
- MeAction(playerid, "достал ключи и открыл транспорт");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment