!spec script release [message #329028] |
Mon, 05 May 2008 03:15 |
|
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!
|
|
|
|
|
|
|
Re: !spec script release [message #329060 is a reply to message #329059] |
Mon, 05 May 2008 07:09 |
_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 |
|
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 |
_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 #329095 is a reply to message #329071] |
Mon, 05 May 2008 11:44 |
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 #330126 is a reply to message #329028] |
Sun, 11 May 2008 15:01 |
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 #330521 is a reply to message #330468] |
Wed, 14 May 2008 10:03 |
|
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!
|
[Updated on: Thu, 15 May 2008 03:00] Report message to a moderator
|
|
|
|
Re: !spec script release [message #330646 is a reply to message #329028] |
Thu, 15 May 2008 12:18 |
|
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!
|
[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 |
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 #330683 is a reply to message #330646] |
Thu, 15 May 2008 14:35 |
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?
|
|
|