Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » !spec script release  () 5 Votes
!spec script release [message #329028] Mon, 05 May 2008 03:15 Go to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
Usage,

Uses a mods.txt file for the people who are allowed to spec,
this also can be hard coded but i dont know how to do that
since im not awesome o coder.

I think the following installation is fine though i didnt used the code anymore so idk.

i tested it and it was working without crashes bugs etc.

gmscripts.cpp : source file
void Player_Spectate::Created(GameObject *obj) {
Commands->Set_Is_Visible(obj,false);
Commands->Set_Model(obj,"null");
Commands->Set_Shield_Type(obj,"Blamo");
Commands->Clear_Weapons(obj);
Toggle_Fly_Mode(obj);
Commands->Disable_All_Collisions(obj);
}
class spectateChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
if(Is_Mod(Get_Player_Name_By_ID(ID))) {
if (Is_Script_Attached(obj,"Player_Spectate")) {
Commands->Destroy_Object(obj);
}
else {
Commands->Attach_Script(obj,"Player_Spectate","");
}
}
}
};
ChatCommandRegistrant<spectateChatCommand> spectateChatCommandReg("!spec",CHATTYPE_ALL,0,GAMEMODE_AOW);
ScriptRegistrant<Player_Spectate> Player_Spectate_Registrant("Player_Spectate","");


gmmain.cpp
/* Renegade Scripts.dll
SSGM main functions and classes
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<fstream>
usingnamespace std;
#include<stdarg.h>
#include"scripts.h"
#include"date.h"
#include"engine.h"
#include"gmmain.h"
#ifdef WIN32
#include<ddeml.h>
#else
#include <dlfcn.h>
#endif
 
bool OkLoad = false;
#ifndef WIN32
extern void *bhs;
UnloaderClass Unloader;
#endif
DataStruct *Data = 0;
SettingsStruct *Settings = 0;
bool Is_Mod(constchar *Name)
{
fstream file("mods.txt", ios::in);
string tmp;
while(file >> tmp)
{ 
if(strcmp(Name, tmp.c_str()) == 0)
{
return 1;
}
}
return 0;
}



Header script
class Player_Spectate : public ScriptImpClass {
public:
void Created(GameObject *obj);
};


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: !spec script release [message #329046 is a reply to message #329028] Mon, 05 May 2008 05:32 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
Why release something that someone else has and you just did a few edits?

At least give credits


goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: !spec script release [message #329057 is a reply to message #329028] Mon, 05 May 2008 06:50 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
i tryed to made one JUST like that white dragon fixed it up to be the same way u have it...so old news for me hex is right Razz but one thing is....u move to slow find a wya to increase the speed
Re: !spec script release [message #329059 is a reply to message #329028] Mon, 05 May 2008 06:53 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
No, but you can teleport yourself... or rather set_pos


Re: !spec script release [message #329060 is a reply to message #329059] Mon, 05 May 2008 07:09 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
reborn wrote on Mon, 05 May 2008 06:53

No, but you can teleport yourself... or rather set_pos

i think to make it better it whould be better if u can set ur pos to the guy ur spectating cause that code u move to damn slow...
Re: !spec script release [message #329061 is a reply to message #329028] Mon, 05 May 2008 07:14 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Yeah, you could get the position of the guy you want to spectates GameObject *, then set you position to his position, but maybe .Z += 3.0f of something on that dudes Vector3 position before you set your position there, so you're just above his head.


Re: !spec script release [message #329062 is a reply to message #329061] Mon, 05 May 2008 07:24 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
reborn wrote on Mon, 05 May 2008 07:14

Yeah, you could get the position of the guy you want to spectates GameObject *, then set you position to his position, but maybe .Z += 3.0f of something on that dudes Vector3 position before you set your position there, so you're just above his head.

i dont know c++ so im hopeing someone can add that cuase then id love to use it in the one i got which is pretty much the same hting but i dont wanna piss everyone off agian by askin
Re: !spec script release [message #329071 is a reply to message #329046] Mon, 05 May 2008 08:32 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
Hex wrote on Mon, 05 May 2008 14:32

Why release something that someone else has and you just did a few edits?

At least give credits

i dont give credits to ppl who made something that didnt work...


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: !spec script release [message #329073 is a reply to message #329028] Mon, 05 May 2008 08:50 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Attach the Player to another palyer, then you have a Spectate mode Very Happy
Re: !spec script release [message #329095 is a reply to message #329071] Mon, 05 May 2008 11:44 Go to previous messageGo to next message
MacKinsey is currently offline  MacKinsey
Messages: 83
Registered: March 2008
Karma: 0
Recruit
renalpha wrote on Mon, 05 May 2008 10:32

Hex wrote on Mon, 05 May 2008 14:32

Why release something that someone else has and you just did a few edits?

At least give credits

i dont give credits to ppl who made something that didnt work...

But witte helped you a bit, with the mods.txt.
Look here
And i don´t think if you arent a good coder, that u coded the rest of it.
Re: !spec script release [message #329098 is a reply to message #329028] Mon, 05 May 2008 12:17 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
im not a good coder i used piece of codes and read tutorial sites.

also i did not knew that witte posted that code there.

so ye i still figured it out myself
kthx


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: !spec script release [message #329128 is a reply to message #329071] Mon, 05 May 2008 13:39 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
renalpha wrote on Mon, 05 May 2008 16:32

Hex wrote on Mon, 05 May 2008 14:32

Why release something that someone else has and you just did a few edits?

At least give credits

i dont give credits to ppl who made something that didnt work...


Is_Mod works just fine :/
Re: !spec script release [message #329129 is a reply to message #329071] Mon, 05 May 2008 13:51 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
renalpha wrote on Mon, 05 May 2008 11:32

Hex wrote on Mon, 05 May 2008 14:32

Why release something that someone else has and you just did a few edits?

At least give credits

i dont give credits to ppl who made something that didnt work...


What was posted http://www.renegadeforums.com/index.php?t=msg&goto=277603&rid=2253&s rch=spec#msg_277603 works fine, it was a cut down version of what we have used for ages


goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: !spec script release [message #329512 is a reply to message #329129] Wed, 07 May 2008 16:06 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3807
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Its still proper to give credit to the person that made the original code, even if it does not work.

Especially sense under American law anything a person writes is copyrighted. Sarcasm


Re: !spec script release [message #330028 is a reply to message #329028] Sun, 11 May 2008 07:16 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
lol cred to hex
kthxbaigoawaynub


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: !spec script release [message #330126 is a reply to message #329028] Sun, 11 May 2008 15:01 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
renalpha wrote on Mon, 05 May 2008 05:15

Usage,

Uses a mods.txt file for the people who are allowed to spec,
this also can be hard coded but i dont know how to do that
since im not awesome o coder.

I think the following installation is fine though i didnt used the code anymore so idk.

i tested it and it was working without crashes bugs etc.

gmscripts.cpp : source file
void Player_Spectate::Created(GameObject *obj) {
Commands->Set_Is_Visible(obj,false);
Commands->Set_Model(obj,"null");
Commands->Set_Shield_Type(obj,"Blamo");
Commands->Clear_Weapons(obj);
Toggle_Fly_Mode(obj);
Commands->Disable_All_Collisions(obj);
}
class spectateChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
if(Is_Mod(Get_Player_Name_By_ID(ID))) {
if (Is_Script_Attached(obj,"Player_Spectate")) {
Commands->Destroy_Object(obj);
}
else {
Commands->Attach_Script(obj,"Player_Spectate","");
}
}
}
};
ChatCommandRegistrant<spectateChatCommand> spectateChatCommandReg("!spec",CHATTYPE_ALL,0,GAMEMODE_AOW);
ScriptRegistrant<Player_Spectate> Player_Spectate_Registrant("Player_Spectate","");


gmmain.cpp
/* Renegade Scripts.dll
SSGM main functions and classes
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<fstream>
usingnamespace std;
#include<stdarg.h>
#include"scripts.h"
#include"date.h"
#include"engine.h"
#include"gmmain.h"
#ifdef WIN32
#include<ddeml.h>
#else
#include <dlfcn.h>
#endif
 
bool OkLoad = false;
#ifndef WIN32
extern void *bhs;
UnloaderClass Unloader;
#endif
DataStruct *Data = 0;
SettingsStruct *Settings = 0;
bool Is_Mod(constchar *Name)
{
fstream file("mods.txt", ios::in);
string tmp;
while(file >> tmp)
{ 
if(strcmp(Name, tmp.c_str()) == 0)
{
return 1;
}
}
return 0;
}



Header script
class Player_Spectate : public ScriptImpClass {
public:
void Created(GameObject *obj);
};


Umm, sorry for asking this, but how do you make this work?


This account is no longer being active.
Re: !spec script release [message #330130 is a reply to message #329028] Sun, 11 May 2008 16:05 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
c++?

Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: !spec script release [message #330132 is a reply to message #330130] Sun, 11 May 2008 16:10 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
SHIT
I do have c++ but i dont know what to save the file as and stuff. Could you guys help me?


This account is no longer being active.
Re: !spec script release [message #330468 is a reply to message #330130] Wed, 14 May 2008 01:41 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3807
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
renalpha wrote on Sun, 11 May 2008 17:05

c++?

C++


Re: !spec script release [message #330521 is a reply to message #330468] Wed, 14 May 2008 10:03 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
Jerad Gray wrote on Wed, 14 May 2008 10:41

renalpha wrote on Sun, 11 May 2008 17:05

c++?

C++

im sorry i typed that however ur reply was just lame.
kthx


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

[Updated on: Thu, 15 May 2008 03:00]

Report message to a moderator

Re: !spec script release [message #330642 is a reply to message #330521] Thu, 15 May 2008 12:08 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
Can i use Notepad++ instead of C++
Here is where you could get Notpepad++ :
http://sourceforge.net/projects/notepad-plus/


This account is no longer being active.
Re: !spec script release [message #330646 is a reply to message #329028] Thu, 15 May 2008 12:18 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
probally it wont compile
just buy Visual studios and start enjoying it.


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

[Updated on: Thu, 15 May 2008 23:18] by Moderator

Report message to a moderator

Re: !spec script release [message #330650 is a reply to message #330646] Thu, 15 May 2008 12:43 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
I just copy and paste the first code into C++ and then save is as "gmscripts.cpp" and then copy paste the second code into a completely new c++ file and then save it as "gmmain.cpp"
And i didnt get the last part.
(Is this code for renegade or fds?)


This account is no longer being active.
Re: !spec script release [message #330652 is a reply to message #329028] Thu, 15 May 2008 12:45 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Follow this tutorial for setting up a build environment:

http://www.renegadeforums.com/index.php?t=msg&th=26642&start=0&rid=3 415



Re: !spec script release [message #330683 is a reply to message #330646] Thu, 15 May 2008 14:35 Go to previous messageGo to previous message
slavik262 is currently offline  slavik262
Messages: 79
Registered: February 2007
Karma: 0
Recruit
renalpha wrote on Thu, 15 May 2008 14:18

probally it wont compile
just download Visual studios from some warez site and start enjoying it.


You do realize that the Express Edition, which is all you need to write scripts (and frankly, do almost anything else) , is completely free?


http://img432.imageshack.us/img432/7862/userbar405373ux.gif
Previous Topic: C++. Need help.
Next Topic: Scripts
Goto Forum:
  


Current Time: Wed Sep 04 08:06:57 MST 2024

Total time taken to generate the page: 0.01113 seconds