Home » Renegade Discussions » Mod Forum » !spec script release
() 5 Votes
!spec script release [message #329028] |
Mon, 05 May 2008 03:15 |
|
renalpha
Messages: 1000 Registered: January 2007 Location: Holland - Zuid-Holland - ...
Karma:
|
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!
|
|
|
|
Goto Forum:
Current Time: Fri Dec 27 01:29:16 MST 2024
Total time taken to generate the page: 0.01220 seconds
|