Originally Posted by Threshold
Your OnDialogResponse:
pawn Код:
if(dialogid == DIALOG_CDLOCKMENU) { if(response) { new idx = PlayerInfo[playerid][InBusiness]; if(IsNumeric(inputtext)) { new 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; } new var = GetPVarInt(playerid, "lockmenu"); if(var != 1 && var != 2) { SetPVarInt(playerid, "lockmenu", 0); return SendClientMessage(playerid, 0xFF000FF, "Invalid selection."); } if(PlayerVehicleInfo[playerid][pvid][pvLock] == var) { SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle."); SetPVarInt(playerid, "lockmenu", 0); return 1; } SendClientMessage(playerid, COLOR_GRAD4, ((var == 1) ? (" You have purchased an alarm lock!") : (" You have Purchased an industrial lock!"))); SendClientMessage(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car."); PlayerInfo[playerid][pCash] -= ((var == 1) ? (BizInfo[idx][bProductsPrice11]) : (BizInfo[idx][bProductsPrice12])); BizInfo[idx][bMoney] += ((var == 1) ? (BizInfo[idx][bProductsPrice11]) : (BizInfo[idx][bProductsPrice12])); BizInfo[idx][bSupplies]--; PlayerVehicleInfo[playerid][pvid][pvLock] = var; SetPVarInt(playerid, "lockmenu", 0); } } return 1; } //--------------------------------------------// if(dialogid == DIALOG_ELOCK1) { if(GetPVarInt(playerid, "lockmenu") == 4) { if(IsNumeric(inputtext)) { new 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]; SendClientMessageEx(playerid, COLOR_GRAD4, " You have successfuly installed an electric shock lock!"); 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 Electric Shock Lock to their Vehicle", GetPlayerNameEx(playerid), playerid); ABroadCast(COLOR_YELLOW, String, 2); } } return 1; }
I have no idea where this code is even from??:
pawn Код:
} 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; }
|