Home » Renegade Discussions » Mod Forum » Veteran Plugin.
() 1 Vote
Re: Veteran Plugin. [message #301078 is a reply to message #301049] |
Tue, 04 December 2007 17:00 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Hex wrote on Tue, 04 December 2007 17:43 | I'm not bothered about releasing code or people changing it, what annoys me is people that made snide comments because you don't.
reborn wrote on Sat, 01 December 2007 06:55 | The was a link to one spammed all over these forums
|
Need I say more.
|
Well, I posted that after you removed the public links (or had them removed).
Look, I think you have assumed me to be some self-rightous annoying butt-hole. I'm not trying to get on your tits.
I believe that making your code available to everyone is a good thing. Seeing as how you've released the .dll I can't see the issue with releasing the source code.
I don't want to make a big thing about it, and I don't want us to fall out over it. It's nice that you have released a plug-in for people to use. If you want to leave it at that then that's fine. You done a good thing.
I believe you could do a better thing by releasing the source code too, but it's up to you.
The plug-in you made seems to work great and I congratulate you on it.
I would like to leave it on the note though that your plug-in would not exist today if it wasn't for someone else releasing there source. What you accomplished would not of been possible, or would of been allot harder, if it wasn't for someone else releasing there source code.
|
|
|
Re: Veteran Plugin. [message #307343 is a reply to message #300286] |
Wed, 02 January 2008 10:26 |
|
wittebolx
Messages: 332 Registered: May 2007 Location: the netherlands
Karma: 0
|
Recruit |
|
|
hey reborn about the vet system, i added your code and tried to compile it, but there were many errors.
i got some help from roshambo with fixing some of the errors but at a moment roshambo said he needed the functions.
i cant seem to find those?
can you help on that?
1>gmmain.obj : error LNK2019: unresolved external symbol "bool __cdecl IsLowClassVehicle(char const *)" (?IsLowClassVehicle@@YA_NPBD@Z) referenced in function "private: virtual void __thiscall reb_vet_System_Vehicles::Custom(unsigned char *,int,int,unsigned char *)" (?Custom@reb_vet_System_Vehicles@@EAEXPAEHH0@Z)
1>gmscripts.obj : error LNK2019: unresolved external symbol "int __cdecl GetPoints(char const *)" (?GetPoints@@YAHPBD@Z) referenced in function "private: virtual void __thiscall MDB_SSGM_Player::Killed(unsigned char *,unsigned char *)" (?Killed@MDB_SSGM_Player@@EAEXPAE0@Z)
1>scripts.dll : fatal error LNK1120: 2 unresolved externals
http://www.wittebolx.com
[Updated on: Wed, 02 January 2008 10:56] Report message to a moderator
|
|
|
|
Re: Veteran Plugin. [message #307600 is a reply to message #307350] |
Thu, 03 January 2008 10:14 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
RoShamBo wrote on Wed, 02 January 2008 12:37 | IsLowClassVehicle
GetPoints
are missing
|
I forgot about those...
int GetPoints(const char* Preset) {
int VetWorth = 0;
if (stricmp(Preset,"CnC_GDI_Engineer_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_Engineer_2SF") == 0) VetWorth = 3;
else if (stricmp(Preset,"CnC_GDI_Grenadier_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_Grenadier_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Ignatio_Mobius")) VetWorth = 3;
else if (stricmp(Preset,"CnC_GDI_MiniGunner_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_MiniGunner_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_GDI_MiniGunner_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_MiniGunner_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_GDI_RocketSoldier_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_RocketSoldier_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_GDI_RocketSoldier_2SF") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_Engineer_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_FlameThrower_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_FlameThrower_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_FlameThrower_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_FlameThrower_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Nod_Minigunner_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_Minigunner_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_Minigunner_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Minigunner_3Boss")) VetWorth = 3;
else if (strstr(Preset,"CnC_Nod_MiniGunner_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Nod_RocketSoldier_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_RocketSoldier_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_RocketSoldier_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_RocketSoldier_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Nod_Technician_0") == 0) VetWorth = 3;
else if (strstr(Preset,"CnC_Sydney_PowerSuit")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Sydney") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_APC")) VetWorth = 3;
else if (strstr(Preset,"CnC_GDI_Humm-vee")) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_MRLS")) VetWorth = 3;
else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) VetWorth = 2;
else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_APC")) VetWorth = 3;
else if (strstr(Preset,"CnC_Nod_Buggy")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) VetWorth = 3;
else if (strstr(Preset,"Nod_Chameleon")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Recon_Bike")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Transport")) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_Transport")) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_Medium_Tank")) VetWorth = 4;
else if (strstr(Preset,"CnC_GDI_Mammoth_Tank")) VetWorth = 5;
else if (strstr(Preset,"CnC_Nod_Light_Tank")) VetWorth = 4;
else if (strstr(Preset,"CnC_Nod_Flame_Tank")) VetWorth = 4;
else if (strstr(Preset,"CnC_Nod_Stealth_Tank")) VetWorth = 5;
else if (strstr(Preset,"CnC_Nod_Apache")) VetWorth = 4;
else if (strstr(Preset,"CnC_GDI_Orca")) VetWorth = 4;
else if (strstr(Preset,"CnC_GDI_Harvester")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Harvester")) VetWorth = 2;
return VetWorth;
}
bool IsLowClassVehicle(const char *Preset) {
if (strstr(Preset,"CnC_GDI_APC")) return true;
else if (strstr(Preset,"CnC_GDI_Humm-vee")) return true;
else if (strstr(Preset,"CnC_GDI_MRLS")) return true;
else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) return true;
else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) return true;
else if (strstr(Preset,"CnC_Nod_APC")) return true;
else if (strstr(Preset,"CnC_Nod_Buggy")) return true;
else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) return true;
else if (strstr(Preset,"Nod_Chameleon")) return true;
else if (strstr(Preset,"CnC_Nod_Recon_Bike")) return true;
else if (strstr(Preset,"CnC_Nod_Transport")) return true;
else if (strstr(Preset,"CnC_GDI_Transport")) return true;
return false;
}
|
|
|
|
|
|
|
|
Re: Veteran Plugin. [message #321166 is a reply to message #300286] |
Sat, 08 March 2008 09:22 |
|
Darknes2
Messages: 91 Registered: July 2007 Location: Alaberma
Karma: 0
|
Recruit |
|
|
i have this at the top of gmscripts.cpp
/* Renegade Scripts.dll
SSGM scripts
Copyright 2007 Vloktboky, Whitedragon(MDB), Mac, Jonathan Wilson
This file is part of the Renegade scripts.dll
The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version. See the file COPYING for more details.
In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
Only the source code to the module(s) containing the licenced code has to be released.
*/
#include "scripts.h"
#include "engine.h"
#include "gmmain.h"
#include "gmscripts.h"
#include <iostream>
#pragma warning(disable: 4996)
//Fix for the double created event bug when attaching scripts in the level loaded hook.
MDB_SSGM_Base::MDB_SSGM_Base() {
WasCreated = false;
}
void MDB_SSGM_Base::Created(GameObject *obj) {
if (!WasCreated) {
NewCreated(obj);
WasCreated = true;
}
}
//******************************************************************************
//******************************************************************************
//******************************* veteran STUFF ********************************
struct veteranPlayers {
std::string PlayerName;
int veteranPoints;
};
std::vector<veteranPlayers> VetInfo;
void VetUpdate(int ID, int number, int score) {
if (!VetInfo.empty()) {
for (int i = 0; i < VetInfo.size(); i++) {
if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) {
int cvp, now;
cvp = VetInfo[i].veteranPoints;
now = number + cvp;
VetInfo[i].veteranPoints = now;
int Team;
Team = Get_Team(ID);
if (cvp < 100 && now >= 100) {
char Promote[255];
sprintf(Promote,"msg veteran: %s just got promoted to the rank of General", Get_Player_Name_By_ID(ID));
Console_Input(Promote);
if (Team == 0) {
sprintf(Promote, "ppage %d Kane has recognised your vision, you have been promoted to General, enjoy the extra 45HP armor on all NEW characters", ID);
Commands->Create_2D_WAV_Sound("bonus_complete.wav");
}
else {
sprintf(Promote, "ppage %d Locke himself has promoted you to a General, enjoy the extra 45HP armor on all NEW characters", ID);
Commands->Create_2D_WAV_Sound("bonus_complete.wav");
}
Console_Input(Promote);
}
else if (cvp < 60 && now >= 60) {
char Promote[255];
sprintf(Promote,"msg veteran: %s just got promoted to the rank of Brigadier", Get_Player_Name_By_ID(ID));
Console_Input(Promote);
if (Team == 0) {
sprintf(Promote, "ppage %d The Brotherhood of Nod likes your style, you are promoted to rank Brigadier, enjoy the extra 30HP armor on all NEW characters", ID);
Commands->Create_2D_WAV_Sound("m00bgwf_kill0031i1nbrs_snd.wav");
}
else {
sprintf(Promote, "ppage %d Keep em coming! you done all that left handed? You are promoted to Brigadier, enjoy the extra 30HP armor on all NEW characters", ID);
Commands->Create_2D_WAV_Sound("m00achk_kill0034i1gbmg_snd.wav");
}
Console_Input(Promote);
}
else if (cvp < 30 && now >= 30) {
char Promote[255];
sprintf(Promote,"msg veteran: %s just got promoted to the rank of Major, he gets an extra 15HP armor on every character he now buys", Get_Player_Name_By_ID(ID));
Console_Input(Promote);
if (Team == 0) {
sprintf(Promote, "ppage %d Kane wants you in his elite, you are promoted to Major, enjoy the splendors of war brother as every NEW character you buy will have an extra 15HP armor", ID);
Commands->Create_2D_WAV_Sound("m00avis_kick0041i1nsmg_snd.wav");
}
else {
sprintf(Promote, "ppage %d The deadsix needs people like you, you are promoted to Major! Every NEW character from now on will have an extra 15HP armor", ID);
Commands->Create_2D_WAV_Sound("m00_wins0003eval_snd.wav");
}
Console_Input(Promote);
}
break;
}
}
}
}
int VetCheckPoints(int ID) {
if (!VetInfo.empty()) {
for (int i = 0; i < VetInfo.size(); i++) {
if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) {
int Points;
Points = VetInfo[i].veteranPoints;
return Points;
}
}
}
return 0;
}
bool VetCheck(int ID) {
if (!VetInfo.empty()) {
for (int i = 0; i < VetInfo.size(); i++) {
if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) {
return true;
}
}
}
return false;
}
void VetAddPlayer(int ID) {
if (VetCheck(ID) == false) {
veteranPlayers temp;
temp.PlayerName = Get_Player_Name_By_ID(ID);
temp.veteranPoints = 0;
VetInfo.push_back(temp);
}
}
void VetClearPlayers() {
VetInfo.erase(VetInfo.begin(), VetInfo.end());
int Players = The_Game()->MaxPlayers;
for (int i = 1; i <= Players; i++) {
if (Get_GameObj(i)) {
VetAddPlayer(i);
}
};
bool IsLowClassVehicle(const char *Preset) {
if (strstr(Preset,"CnC_GDI_APC")) return true;
else if (strstr(Preset,"CnC_GDI_Humm-vee")) return true;
else if (strstr(Preset,"CnC_GDI_MRLS")) return true;
else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) return true;
else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) return true;
else if (strstr(Preset,"CnC_Nod_APC")) return true;
else if (strstr(Preset,"CnC_Nod_Buggy")) return true;
else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) return true;
else if (strstr(Preset,"Nod_Chameleon")) return true;
else if (strstr(Preset,"CnC_Nod_Recon_Bike")) return true;
else if (strstr(Preset,"CnC_Nod_Transport")) return true;
else if (strstr(Preset,"CnC_GDI_Transport")) return true;
return false;
}
int GetPoints(const char* Preset) {
int VetWorth = 0;
if (stricmp(Preset,"CnC_GDI_Engineer_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_Engineer_2SF") == 0) VetWorth = 3;
else if (stricmp(Preset,"CnC_GDI_Grenadier_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_Grenadier_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Ignatio_Mobius")) VetWorth = 3;
else if (stricmp(Preset,"CnC_GDI_MiniGunner_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_MiniGunner_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_GDI_MiniGunner_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_MiniGunner_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_GDI_RocketSoldier_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_GDI_RocketSoldier_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_GDI_RocketSoldier_2SF") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_Engineer_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_FlameThrower_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_FlameThrower_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_FlameThrower_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_FlameThrower_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Nod_Minigunner_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_Minigunner_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_Minigunner_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Minigunner_3Boss")) VetWorth = 3;
else if (strstr(Preset,"CnC_Nod_MiniGunner_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Nod_RocketSoldier_0") == 0) VetWorth = 1;
else if (stricmp(Preset,"CnC_Nod_RocketSoldier_1Off") == 0) VetWorth = 2;
else if (stricmp(Preset,"CnC_Nod_RocketSoldier_2SF") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_RocketSoldier_3Boss")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Nod_Technician_0") == 0) VetWorth = 3;
else if (strstr(Preset,"CnC_Sydney_PowerSuit")) VetWorth = 3;
else if (stricmp(Preset,"CnC_Sydney") == 0) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_APC")) VetWorth = 3;
else if (strstr(Preset,"CnC_GDI_Humm-vee")) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_MRLS")) VetWorth = 3;
else if (strstr(Preset,"CnC_Civilian_Pickup01_Secret")) VetWorth = 2;
else if (strstr(Preset,"CnC_Civilian_Sedan01_Secret")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_APC")) VetWorth = 3;
else if (strstr(Preset,"CnC_Nod_Buggy")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Mobile Artillery")) VetWorth = 3;
else if (strstr(Preset,"Nod_Chameleon")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Recon_Bike")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Transport")) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_Transport")) VetWorth = 2;
else if (strstr(Preset,"CnC_GDI_Medium_Tank")) VetWorth = 4;
else if (strstr(Preset,"CnC_GDI_Mammoth_Tank")) VetWorth = 5;
else if (strstr(Preset,"CnC_Nod_Light_Tank")) VetWorth = 4;
else if (strstr(Preset,"CnC_Nod_Flame_Tank")) VetWorth = 4;
else if (strstr(Preset,"CnC_Nod_Stealth_Tank")) VetWorth = 5;
else if (strstr(Preset,"CnC_Nod_Apache")) VetWorth = 4;
else if (strstr(Preset,"CnC_GDI_Orca")) VetWorth = 4;
else if (strstr(Preset,"CnC_GDI_Harvester")) VetWorth = 2;
else if (strstr(Preset,"CnC_Nod_Harvester")) VetWorth = 2;
return VetWorth;
}
}
void reb_vet_System::Created(GameObject *obj) {
int Points;
Points = VetCheckPoints(Get_Player_ID(obj));
if (Points >= 100) {
Level = 3;
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str());
IconID = Commands->Get_ID(Icon);
Commands->Set_Model(Icon, "p_keycrd_red");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
Set_Max_Shield_Strength(obj, 145);
Commands->Set_Shield_Strength(obj, 145);
Commands->Start_Timer(obj, this, 2.0f, 3);
}
else if (Points >= 60) {
Level = 2;
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str());
Commands->Set_Model(Icon, "p_keycrd_yel");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
IconID = Commands->Get_ID(Icon);
Set_Max_Shield_Strength(obj, 130);
Commands->Set_Shield_Strength(obj, 130);
}
else if (Points >= 30) {
Level = 1;
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str());
Commands->Set_Model(Icon, "p_keycrd_grn");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
IconID = Commands->Get_ID(Icon);
if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){
}
Set_Max_Shield_Strength(obj, 115);
Commands->Set_Shield_Strength(obj, 115);
}
else {
Level = 0;
}
Commands->Start_Timer(obj, this, 60.0f, 10);
}
void reb_vet_System::Custom(GameObject *obj, int message, int param, GameObject *sender) {
if (message == CUSTOM_EVENT_VEHICLE_ENTER) {
Commands->Destroy_Object(Commands->Find_Object(IconID));
}
else if (Level == 3) {
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str());
Commands->Set_Model(Icon, "p_keycrd_red");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
IconID = Commands->Get_ID(Icon);
float Shield;
Shield = Commands->Get_Shield_Strength(obj);
Set_Max_Shield_Strength(obj, 145);
Commands->Set_Shield_Strength(obj, Shield);
}
else if (Level == 2) {
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str());
Commands->Set_Model(Icon, "p_keycrd_yel");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
IconID = Commands->Get_ID(Icon);
float Shield;
Shield = Commands->Get_Shield_Strength(obj);
Set_Max_Shield_Strength(obj, 130);
Commands->Set_Shield_Strength(obj, Shield);
}
else if (Level == 1) {
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Attach_Script(Icon,"MDB_SSGM_Destroy_When_Object_Destroyed",ToString(Commands->Get_ID(obj)).c_str());
IconID = Commands->Get_ID(Icon);
Commands->Set_Model(Icon, "p_keycrd_grn");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")){
}
float Shield;
Shield = Commands->Get_Shield_Strength(obj);
Set_Max_Shield_Strength(obj, 115);
Commands->Set_Shield_Strength(obj, Shield);
}
Commands->Start_Timer(obj, this, 60.0f, 10);
}
void reb_vet_System::Timer_Expired(GameObject *obj, int number) {
if (number == 3) {
Commands->Apply_Damage(obj, -1.0f, "Repair", false);
Commands->Start_Timer(obj, this, 2.0f, 5);
}
else if (number == 10) {
int Points;
Points = VetCheckPoints(Get_Player_ID(obj));
if (Points >= 100 && Level < 3) {
Level = 3;
if (Get_Vehicle(obj) == 0) {
Commands->Destroy_Object(Commands->Find_Object(ID));
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Set_Model(Icon, "p_keycrd_red");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
ID = Commands->Get_ID(Icon);
}
Commands->Start_Timer(obj, this, 2.0f, 3);
}
else if (Points >= 60 && Level < 2) {
Level = 2;
if (Get_Vehicle(obj) == 0) {
Commands->Destroy_Object(Commands->Find_Object(ID));
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Set_Model(Icon, "p_keycrd_yel");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
ID = Commands->Get_ID(Icon);
}
}
else if (Points >= 30 && Level < 1) {
Level = 1;
if (Get_Vehicle(obj) == 0) {
Commands->Destroy_Object(Commands->Find_Object(ID));
GameObject *Icon = Commands->Create_Object_At_Bone(obj,"Invisible_Object", "c L THIGH");
Commands->Set_Model(Icon, "p_keycrd_grn");
Commands->Attach_To_Object_Bone(Icon, obj, "c L THIGH");
ID = Commands->Get_ID(Icon);
}
}
Commands->Start_Timer(obj, this, 60.0f, 10);
}
}
void reb_vet_System::Killed(GameObject *obj, GameObject *shooter) {
Destroy_Script();
}
void reb_vet_System::Destroyed(GameObject *obj) {
Commands->Destroy_Object(Commands->Find_Object(IconID));
Destroy_Script();
}
void reb_vet_System_Vehicles::Custom(GameObject *obj, int message, int param, GameObject *sender) {
if (message == CUSTOM_EVENT_VEHICLE_ENTER) {
int Points;
Points = VetCheckPoints(Get_Player_ID(sender));
if (Points >= 100) {
Level = 3;
IsPoweredUp = true;
if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) {
//nothing
}
else {
Commands->Start_Timer(obj, this, 1.0f, 3);
}
}
else if (Points >= 60) {
Level = 2;
IsPoweredUp = true;
if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) {
//nothing
Commands->Start_Timer(obj, this, 1.0f, 2);
}
else {
Commands->Start_Timer(obj, this, 1.0f, 3);
}
}
else if (Points >= 30) {
Level = 1;
IsPoweredUp = true;
if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) {
//nothing
}
else {
Commands->Start_Timer(obj, this, 1.0f, 1);
}
}
Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_ENTER, 0, 0);
}
else if (message == CUSTOM_EVENT_VEHICLE_EXIT) {
if (IsPoweredUp == true) {
IsPoweredUp = false;
if (Level == 1) {
if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) {
//nothing
}
}
else if (Level == 2) {
if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) {
//nothing
}
}
else if (Level == 3) {
if (IsLowClassVehicle(Commands->Get_Preset_Name(obj)) == true) {
//nothing
}
}
}
Commands->Send_Custom_Event(sender, sender, CUSTOM_EVENT_VEHICLE_EXIT, 0, 0);
}
}
void reb_vet_System_Vehicles::Timer_Expired(GameObject *obj, int number) {
if (number == 3 && IsPoweredUp == true) {
Commands->Destroy_Object(Commands->Find_Object(ID));
Commands->Apply_Damage(obj, -3.0f, "Repair", false);
Commands->Start_Timer(obj, this, 1.0f, 3);
}
else if (number == 2 && IsPoweredUp == true) {
float Health, MaxHealth;
Health = Commands->Get_Health(obj);
MaxHealth = Commands->Get_Max_Health(obj);
if (Health == MaxHealth) {
// Nothing
}
else if (Health >= MaxHealth - 2) {
Commands->Set_Health(obj, MaxHealth);
}
else if (Health <= MaxHealth - 3) {
Commands->Set_Health(obj, Health + 3);
}
Commands->Start_Timer(obj, this, 1.0f, 2);
}
else if (number == 1 && IsPoweredUp == true) {
float Shield, MaxShield;
Shield = Commands->Get_Shield_Strength(obj);
MaxShield = Commands->Get_Max_Shield_Strength(obj);
if (Shield == MaxShield) {
// Nothing
}
else if (Shield >= MaxShield - 2) {
Commands->Set_Shield_Strength(obj, MaxShield);
}
else if (Shield <= MaxShield - 3) {
Commands->Set_Shield_Strength(obj, Shield + 3);
}
Commands->Start_Timer(obj, this, 1.0f, 1);
}
}
void reb_vet_System_Vehicles::Killed(GameObject *obj, GameObject *shooter) {
Commands->Destroy_Object(Commands->Find_Object(ID));
Destroy_Script();
}
void reb_vet_System_Vehicles::Destroyed(GameObject *obj) {
Commands->Destroy_Object(Commands->Find_Object(ID));
Destroy_Script();
}
DWC Forums
www.Darknes2.com
|
|
|
Re: Veteran Plugin. [message #321190 is a reply to message #300286] |
Sat, 08 March 2008 13:09 |
EA-DamageEverything
Messages: 423 Registered: January 2005 Location: Germany
Karma: 0
|
Commander |
|
|
I totally agree with Reborn. For ages now it seems that there is a combat between the Server Admins. Everyone of them wants to have the best & new enhancements instead of providing unique Servers with different gameplay.
A quick example: The CCTF mod. I wanted to have it in 2005/2006. Everybody has kept it private, so I asked TGpaddy (TG changed to SoD later FYI). He refused to send it to me. And guess what? I created my own CCTF mod which differed from all other crazy mods.
For the Vetplugin I believe BC had this first. I don't know if I am right, but I saw it first on BCserv4 (the AOW) years ago.
I mean, it's easier to make a modified objects than writing scripts from scratch. So no wondering why people often want to have the finished files and only a few skilled do modify them for their own needs.
So again, I think this is a Community and people should share their work. I for my self do it this way.
|
|
|
|
Re: Veteran Plugin. [message #321212 is a reply to message #300286] |
Sat, 08 March 2008 15:25 |
|
cAmpa
Messages: 597 Registered: March 2006
Karma: 0
|
Colonel |
|
|
Quote: | So again, I think this is a Community and people should share their work. I for my self do it this way.
|
Revoke the a00 shit and i will share my work.
Bückstabü!
|
|
|
|
|
Re: Veteran Plugin. [message #321280 is a reply to message #321269] |
Sun, 09 March 2008 00:30 |
|
saberhawk
Messages: 1068 Registered: January 2006 Location: ::1
Karma: 0
|
General (1 Star) |
|
|
Just declare the function in the second file.
Like void function1(int lol) { dostuff();} in file1, and then void function1(int lol); in file2.
|
|
|
|
Re: Veteran Plugin. [message #330148 is a reply to message #300286] |
Sun, 11 May 2008 19:04 |
EA-DamageEverything
Messages: 423 Registered: January 2005 Location: Germany
Karma: 0
|
Commander |
|
|
error C2653: 'reb_vet_System' : is not a class or namespace name c:\ExScripts\SSGM Source\gmscripts.cpp 215
= paste the whole script into the gmmain.cpp and the class into gmmain.h, this could/should help. I do it this way and everything works.
--------
error C2601: 'GetPoints' : local function definitions are illegal c:\ExScripts\SSGM Source\gmscripts.cpp
= Get_Points would be a valid scripts command.
Over all, the whole code should be placed in one file. You cannot split Reborns' main code because the gmmain.cpp has zero access to the gmscripts.cpp if I am interpreting the include-Syntax right. In the other way, the gmscripts can read gmmain, gmcrate etc.
I probably fail with this post, but I do think it goes in the right direction.
|
|
|
|
|
Re: Veteran Plugin. [message #330261 is a reply to message #300286] |
Mon, 12 May 2008 16:20 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Fixed, check your PM's.
C++ is case sensitive, GetPoints is not the same as getPoints.
Most errors seemed to be case sensitive issues.
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Nov 28 14:23:05 MST 2024
Total time taken to generate the page: 0.01497 seconds
|