Home » Renegade Discussions » Mod Release Forum » [script]!sellveh
() 3 Votes
Re: !sellveh [message #342237 is a reply to message #341988] |
Mon, 21 July 2008 08:22 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma:
|
General (3 Stars) |
|
|
Hex wrote on Sun, 20 July 2008 09:21 | I would use Get_Cost(Commands->Get_Preset_Name(obj))/2 rarther than having to do it for each vehicle
|
I did update the code to do this and posted it earlier in the thread:
void reb_sell_veh::Timer_Expired(GameObject *obj, int number){
if(number == 1){
if(Commands->Find_Object(VehID)){
unsigned int worth;
worth = (Get_Cost((Commands->Get_Preset_Name(Commands->Find_Object(VehID))))/2);
if (worth > 0){
Console_Input(StrFormat("ppage %d Your vehicle was successfully sold for $%i.",Get_Player_ID(obj),worth).c_str());
Commands->Give_Money(obj,GetValue(Commands->Get_Preset_Name(Find_My_Veh(obj))), 0);
Commands->Destroy_Object(Find_My_Veh(obj));
sellingveh = false;
}
else {
float value = GetValue(Commands->Get_Preset_Name(Find_My_Veh(obj)));
Console_Input(StrFormat("ppage %d Your vehicle was successfully sold for $%f.",Get_Player_ID(obj),value).c_str());
Commands->Give_Money(obj,GetValue(Commands->Get_Preset_Name(Find_My_Veh(obj))), 0);
Commands->Destroy_Object(Find_My_Veh(obj));
sellingveh = false;
}
}
}
}
The only reason I don't rely on get_cost is because allot of the maps on my server use temped presets with varying costs, and that function will not work with them.
But for renegade that else would most likely never get called.
|
|
|
|
|
[script]!sellveh
By: reborn on Wed, 23 April 2008 16:13
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Wed, 23 April 2008 16:22
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: BlueThen on Wed, 23 April 2008 16:30
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Wed, 23 April 2008 16:34
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: KobraOps on Wed, 23 April 2008 16:52
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Wed, 23 April 2008 23:09
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Thu, 24 April 2008 04:41
|
|
|
Re: !sellveh
By: reborn on Thu, 24 April 2008 08:56
|
|
|
Re: !sellveh
By: reborn on Thu, 12 June 2008 03:09
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Thu, 12 June 2008 08:04
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Thu, 12 June 2008 08:55
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Thu, 12 June 2008 09:36
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Thu, 12 June 2008 10:32
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Fri, 13 June 2008 03:18
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: reborn on Fri, 13 June 2008 12:35
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
|
|
|
Re: !sellveh
By: Hex on Sun, 20 July 2008 06:21
|
|
|
Re: !sellveh
By: reborn on Mon, 21 July 2008 08:22
|
|
|
Re: !sellveh
By: Hex on Mon, 21 July 2008 08:49
|
Goto Forum:
Current Time: Tue Nov 26 11:08:49 MST 2024
Total time taken to generate the page: 0.01109 seconds
|