Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(dialogid == DIALOG_CDLOCKMENU)
- {
- new idx = PlayerInfo[playerid][InBusiness];
- if(response) {
- if(GetPVarInt(playerid, "lockmenu") == 1) {
- new pvid;
- if(IsNumeric(inputtext)) {
- pvid = strval(inputtext)-1;
- if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
- {
- SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
- SetPVarInt(playerid, "lockmenu", 0);
- return 1;
- }
- if(PlayerVehicleInfo[playerid][pvid][pvLock] == 1)
- {
- SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
- SetPVarInt(playerid, "lockmenu", 0);
- return 1;
- }
- format(string, sizeof(string), " You have purchased an alarm lock!");
- SendClientMessage(playerid, COLOR_GRAD4, string);
- SendClientMessage(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
- PlayerInfo[playerid][pCash] -= BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice11];
- BizInfo[idx][bMoney] += BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice11];
- BizInfo[idx][bSupplies] --;
- PlayerVehicleInfo[playerid][pvid][pvLock] = 1;
- SetPVarInt(playerid, "lockmenu", 0);
- }
- }
- else if(GetPVarInt(playerid, "lockmenu") == 2)
- {
- new pvid;
- if(IsNumeric(inputtext))
- {
- pvid = strval(inputtext)-1;
- if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
- {
- SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
- SetPVarInt(playerid, "lockmenu", 0);
- return 1;
- }
- if(PlayerVehicleInfo[playerid][pvid][pvLock] == 2)
- {
- SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
- SetPVarInt(playerid, "lockmenu", 0);
- return 1;
- }
- format(string, sizeof(string), " You have Purchased an industrial lock!");
- SendClientMessage(playerid, COLOR_GRAD4, string);
- SendClientMessage(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
- PlayerInfo[playerid][pCash] -= BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice12];
- BizInfo[idx][bMoney] += BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice12];
- BizInfo[idx][bSupplies] --;
- PlayerVehicleInfo[playerid][pvid][pvLock] = 2;
- SetPVarInt(playerid, "lockmenu", 0);
- }
- }
- }
- }
- //--------------------------------------------//
- if(dialogid == DIALOG_ELOCK1)
- {
- if(GetPVarInt(playerid, "lockmenu") == 4)
- {
- new pvid;
- if (IsNumeric(inputtext))
- {
- pvid = strval(inputtext)-1;
- if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
- {
- SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
- SetPVarInt(playerid, "lockmenu", 0);
- return 1;
- }
- if(PlayerVehicleInfo[playerid][pvid][pvLock] == 3)
- {
- SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
- SetPVarInt(playerid, "lockmenu", 0);
- return 1;
- }
- new String[128];
- format(string, sizeof(string), " You have successfuly install an electric shock lock!");
- SendClientMessageEx(playerid, COLOR_GRAD4, string);
- SendClientMessageEx(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
- PlayerVehicleInfo[playerid][pvid][pvLock] = 3;
- SetPVarInt(playerid, "lockmenu", 0);
- format(String, sizeof(String), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) has successfuly installed the Electrict Shock Lock to their Vehicle", GetPlayerNameEx(playerid), playerid);
- ABroadCast(COLOR_YELLOW, String, 2);
- }
- }
- }
- //--------------------------------------------------------//
- }
- else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 1) {
- GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
- SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
- }
- else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 3) {
- new
- string[49 + MAX_PLAYER_NAME];
- if(AdminDuty[playerid] == 1)
- {
- format(string, sizeof(string), "* %s has been stunned by an electric shock lock ",GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new Float:X, Float:Y, Float:Z, Float:HP;
- GetPlayerPos(playerid, X, Y, Z);
- //SendAudioToRange(64, 100, X, Y, Z, 20.0);
- SetPlayerPos(playerid, X + 1, Y, Z);
- RemovePlayerFromVehicle(playerid);
- SetPVarInt(playerid, "IsFrozen", 1);
- TogglePlayerControllable(playerid,0);
- SetTimerEx("ReleasePlayer", 10000, 0, "d", playerid);
- GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
- GetPlayerHealth(playerid,HP);
- SetPlayerHealth(playerid,HP-15);
- }
- else
- {
- format(string, sizeof(string), "Warning: This %s is owned by %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- }
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment