Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM 4.0 Plugin] Vehicle Kills Command
[SSGM 4.0 Plugin] Vehicle Kills Command [message #471987] Thu, 19 July 2012 12:37 Go to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
This plugin adds the !vehkills (alias !vkills) command to the server, this command simply displays the amount of vehicles the players destroyed.

To install place 'VkillsCommand.dll' inside the root FDS folder then add an entry for it under [Plugins] in SSGM.ini.

You can contact me under the nick 'iRANian' on renegadeforums.com.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489718 is a reply to message #471987] Wed, 05 November 2014 13:20 Go to previous messageGo to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
VehiclesDestroyed is inaccessible?
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489720 is a reply to message #489718] Wed, 05 November 2014 20:22 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
They set it to Protected. I don't know why. They changed a lot of functions to protected or private. I just changed the scripts back to public. I don't see it breaking anything.

Here's my 4.1 one. It works as long as you have VehiclesDestroyed in public.


http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489722 is a reply to message #489720] Wed, 05 November 2014 21:52 Go to previous messageGo to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
Xpert wrote on Wed, 05 November 2014 20:22

They set it to Protected. I don't know why. They changed a lot of functions to protected or private. I just changed the scripts back to public. I don't see it breaking anything.

Here's my 4.1 one. It works as long as you have VehiclesDestroyed in public.


Yeah that fixes it, thanks. Big Ups
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489728 is a reply to message #471987] Fri, 07 November 2014 03:58 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
VehDestroyed is offset 0x50 of cPlayer.

The code used to access VehDestroyed is:

.text:11001647                 push    eax
.text:11001648                 call    ebx ; Find_Player(int) ; Find_Player(int)
.text:1100164A                 push    esi
.text:1100164B                 mov     ebp, eax

....

.text:110016A6                 mov     eax, [ebp+50h]



So you can just use something like:

cPlayer *Player = Find_Player(blabla)
int VehsDestroyed;

_asm
{
    mov eax, Player
    mov eax, [eax+0x50]
    mov [VehsDestroyed], eax
}



Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489730 is a reply to message #471987] Fri, 07 November 2014 13:16 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Thumbs Up

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489732 is a reply to message #471987] Fri, 07 November 2014 14:10 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
I don't think roszek knows ASM which is why this is a much easier direct approach lol.

http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489745 is a reply to message #471987] Sun, 09 November 2014 16:22 Go to previous messageGo to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
Fixed, Thanks. Smile
  • Attachment: vKills.rar
    (Size: 10.44KB, Downloaded 139 times)
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489746 is a reply to message #489745] Sun, 09 November 2014 21:15 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
roszek wrote on Sun, 09 November 2014 18:22

Fixed, Thanks. Smile



You need to fix when it counts vehicle shells, guard towers and turrets as a vehicle.


From my 4.0 source code.
void VkillsCommand::OnObjectCreate(void *data,GameObject *obj)
{
	if (obj->As_VehicleGameObj())
	{
		Attach_Script_Once(obj,"Vkills_Vehicle","");
	}
}

void Vkills_Vehicle::Killed(GameObject *obj,GameObject *killer)
{
	if (Commands->Is_A_Star(killer))
	{
		if (strstr(Commands->Get_Preset_Name(obj),"_Destroyed") || strstr(Commands->Get_Preset_Name(obj),"_destroyed") || (Get_Vehicle_Mode(obj) == VEHICLE_TYPE_TURRET))
		{
			((SoldierGameObj*)killer)->Get_Player_Data()->VehiclesDestroyed--;
		}
	}
}

ScriptRegistrant<Vkills_Vehicle> Vkills_Vehicle_Registrant("Vkills_Vehicle","");


http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: [SSGM 4.0 Plugin] Vehicle Kills Command [message #489751 is a reply to message #471987] Mon, 10 November 2014 10:52 Go to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
That's assuming wreckage's use the Destroyed presets. DA for example does not use those presets.

Edit:
DA use's the preset "Mounted"


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Mon, 10 November 2014 10:57]

Report message to a moderator

Previous Topic: [Skin] Stealth Black Hand "Venom" Retexture
Next Topic: mgagd_ag_2 Fix
Goto Forum:
  


Current Time: Sat Apr 13 21:35:52 MST 2024

Total time taken to generate the page: 0.00785 seconds