[SSGM 4.0 Plugin] Vehicle Kills Command [message #471987] |
Thu, 19 July 2012 12:37 |
iRANian
Messages: 4308 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 #489728 is a reply to message #471987] |
Fri, 07 November 2014 03:58 |
iRANian
Messages: 4308 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 #489746 is a reply to message #489745] |
Sun, 09 November 2014 21:15 |
|
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.
|
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","");
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
|
|
|
|