public void Jeterclefveh(Client player, int IDVehicule) { VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoById(IDVehicule); if (objveh == null) { API.sendChatMessageToPlayer(player, Constante.message_idveh_incorrect); } if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 0) { API.sendChatMessageToPlayer(player, "~r~Tu ne possède pas de clé de ce vehicule."); return; } if (Concess.PlayerIsProprio(player, objveh.dbid)) { if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 1) { API.sendChatMessageToPlayer(player, "~r~Tu ne peux pas jeter la derniere clé de ton vehicule."); return; } else { Concess.RemoveKeyVehToPlayer(player, objveh.dbid); API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~r~jeter ~s~une cléf du véhicule ~b~{0} ~s~.", IDVehicule)); return; } } else { Concess.RemoveKeyVehToPlayer(player, objveh.dbid); API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~r~jeter ~s~une cléf du véhicule ~b~{0} ~s~.", IDVehicule)); } }
public void Donnerclefveh(Client player, String idOrName, int IDVehicule) { PlayerInfo objtarget = PlayerInfo.GetPlayerInfotByIdOrName(idOrName); if (objtarget == null) { API.sendChatMessageToPlayer(player, Constante.message_id_incorrect); } VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoById(IDVehicule); if (objveh == null) { API.sendChatMessageToPlayer(player, Constante.message_idveh_incorrect); } if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 0) { API.sendChatMessageToPlayer(player, "~r~Tu ne possède pas de clé de ce vehicule."); return; } if (Concess.PlayerIsProprio(player, objveh.dbid)) { if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 1) { API.sendChatMessageToPlayer(player, "~r~Tu ne peux pas donner la derniere clé de ton vehicule."); return; } else { Concess.RemoveKeyVehToPlayer(player, objveh.dbid); Concess.AddKeyVehToPlayer(objtarget.Handle, objveh.dbid); API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~g~donner ~s~une clé du véhicule ~b~{0} ~s~au joueur ~b~{1}~s~.", IDVehicule, Fonction.RemoveUnderscore(objtarget.PlayerName))); API.sendChatMessageToPlayer(objtarget.Handle, String.Format("~b~{0} ~s~vient de te ~g~donner ~s~une clé du véhicule ~b~{1}~s~.", Fonction.RemoveUnderscore(player.name), IDVehicule)); return; } } else { Concess.RemoveKeyVehToPlayer(player, objveh.dbid); Concess.AddKeyVehToPlayer(objtarget.Handle, objveh.dbid); API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~g~donner ~s~une cléf du véhicule ~b~{0} ~s~au joueur ~b~{1}~s~.", IDVehicule, Fonction.RemoveUnderscore(objtarget.PlayerName))); API.sendChatMessageToPlayer(objtarget.Handle, String.Format("~b~{0} ~s~vient de te ~g~donner ~s~une clé du véhicule ~b~{1}~s~.", Fonction.RemoveUnderscore(player.name), IDVehicule)); } }