Raised This Month: $ Target: $400
 0% 

IsisMod the JavaScript Engine for SourceDS ;)


  
 
 
Thread Tools Display Modes
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 02-27-2005 , 07:22  
#41

Quote:
holy crap.
i was actually right about something!
LoL, everything is posible look at me, i' m noob coder but i made a plugin lol (copied-pasted from the BeetleFart lol)
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
checkmaster
Junior Member
Join Date: Dec 2004
Old 02-27-2005 , 13:01   CreateFakeClient
#42

CreateFakeClient

adding the Code is not my problem! don't know how to compile on linux server my Createfakeclient function is still on Windows working. Can anyone post a manual about compiling under debian linux needed librarys and Versions! would be great! got many errors about that. perhaps i can get some help from coders who did it already.

thx
checkmaster is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 02-27-2005 , 16:24  
#43

Just a question

The code i said work? or you modify it?
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
manorastroman
Senior Member
Join Date: Oct 2004
Old 02-27-2005 , 17:15  
#44

notta clue, i didnt test it (if your talking to me )
__________________
manorastroman is offline
Send a message via AIM to manorastroman Send a message via MSN to manorastroman Send a message via Skype™ to manorastroman
checkmaster
Junior Member
Join Date: Dec 2004
Old 02-28-2005 , 05:07   tested the code before (my own)without java!
#45

i tested the code before (my own)without java!

But my problem was compiling it under linux -> i tried to search an alternative -> Java but I do need to compile too, so who can help me with compiling?
checkmaster is offline
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 02-28-2005 , 05:20   Re: tested the code before (my own)without java!
#46

Quote:
Originally Posted by checkmaster
i tested the code before (my own)without java!

But my problem was compiling it under linux -> i tried to search an alternative -> Java but I do need to compile too, so who can help me with compiling?
What code did you test - or wirte ???

__________________
Rebell is offline
checkmaster
Junior Member
Join Date: Dec 2004
Old 02-28-2005 , 09:07  
#47

the Code to Create a Fake Client:

CON_COMMAND( main_bot, "Creates a Fake Client Spectator" )
{
engine->CreateFakeClient( "Visit:www.Unterfranken-Clan.de" );
}

by adding main_bot to the server.cfg a bot will be created

so how can i compile the code i added to my serverplugin_empty.cpp on linux? I want to add saysounds but only will do this if i got it working on linux dedicated server!

Can someone help me with compiling?
checkmaster is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 05-28-2005 , 19:54   To javascripters
#48

Code:
String.prototype.replaceall = function(whatreplace, toreplace)
{
	var result = this;
	while(result.match(whatreplace))
		result = result.replace(whatreplace, toreplace);
	return result;
}
String.prototype.parse = function(separator)
{
	var result = new Array();
	var pos = 0;
	var pos2 = 0;
	var items = 0;
	var this2 = this
	this2 += separator;
	for(;;)
	{
		pos=pos2
		pos2 = this2.indexOf(separator, pos2);
		if (pos2 != -1)
		{
			result[items] = this.substring(pos, pos2);
			items++;
			pos2++;
		}
		else
			break;
	}
	return result;
}
String.prototype.gettoken = function(index, separator)
{
	var pos = 0;
	var pos2 = 0;
	var items = 0;
	var this2 = this
	this2 += separator;
	for(;;)
	{
		pos2=pos
		pos = this2.indexOf(separator, pos);
		if (pos == -1)
			break;
		if (items+1 == index)
			return this.substring(pos2, pos);
		items++;
		pos++;
	}
	return undefined;
}
String.prototype.gettokencount = function(separator)
{
	var pos = 0;
	var pos2 = 0;
	var items = 0;
	var this2 = this
	this2 += separator;
	for(;;)
	{
		pos2=pos
		pos = this2.indexOf(separator, pos);
		if (pos == -1)
			break;
		items++;
		pos++;
	}
	return items;
}
Does anyone know some better ways to do that?

samples :
Code:
var i,j,k;
var milibefore,miliafter,mili
var stringa = new String("Hello there, this is a simple test ...");
var date = new Date()
milibefore = date.getMilliseconds();
var stringb = stringa.replaceall(" ", "_");
miliafter = date.getMilliseconds();
mili = miliafter-milibefore;
print("Performance report, milliseconds for replaceall : " + mili + "\n");
print("Replaced \" \" by \"_\"\nBefore : \""+stringa+"\"\nAfter : \""+stringb+"\"\n");
var stringc = new String("Omg I finnaly did this function lol");
print("Parsing with parse method...\n");
var date = new Date()
milibefore = date.getMilliseconds();
arraya = stringc.parse(" ");
miliafter = date.getMilliseconds();
mili = miliafter-milibefore;
print("Performance report, milliseconds for parse : " + mili + "\n");
for(i in arraya)
	print("   Arraya["+i+"] = \""+arraya[i]+"\"\n");
print("Parsing with gettoken method...\n");
var arrayb = new Array();
var date = new Date()
milibefore = date.getMilliseconds();
for(j = 0; j<stringc.gettokencount(" "); j++)
	arrayb[j] = stringc.gettoken(j+1, " ");
miliafter = date.getMilliseconds();
mili = miliafter-milibefore;
print("Performance report, milliseconds for gettoken : " + mili + "\n");
for(k in arrayb)
	print("   Arrayb["+k+"] = \""+arrayb[k]+"\"\n");
print("Getting token number : "+stringc.gettokencount(" ")+"\n");
print("Getting token 4 : "+stringc.gettoken(4, " ")+"\n");
Quote:
Performance report, milliseconds for replaceall : 0
Replaced " " by "_"
Before : "Hello there, this is a simple test ..."
After : "Hello_there,_this_is_a_simple_test_..."
Parsing with parse method...
Performance report, milliseconds for parse : 0
Arraya[0] = "Omg"
Arraya[1] = "I"
Arraya[2] = "finnaly"
Arraya[3] = "did"
Arraya[4] = "this"
Arraya[5] = "function"
Arraya[6] = "lol"
Parsing with gettoken method...
Performance report, milliseconds for gettoken : 0
Arrayb[0] = "Omg"
Arrayb[1] = "I"
Arrayb[2] = "finnaly"
Arrayb[3] = "did"
Arrayb[4] = "this"
Arrayb[5] = "function"
Arrayb[6] = "lol"
Getting token number : 7
Getting token 4 : did

Code:
function onFireGameEvent ( event ){
	if (!event.eventname) return;
	if (event.eventname=="player_say"){
		userid=Env.Player[event.userid]
		var tArgs = new String(event.text);
		var tArgv = tArgs.parse(" ");
		var tArgc = tArgs.gettokencount();
		for ( i in tArgv )
			userid.print("Parsing... index "+i+" got value \""+tArgv[i]+"\"\n");
	}
}
Quote:
Cr3V3TT3 : hello guys... ready to rage ??
Parsing... index 0 got value "hello"
Parsing... index 1 got value "guys..."
Parsing... index 2 got value "ready"
Parsing... index 3 got value "to"
Parsing... index 4 got value "rage"
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
Slayor
Junior Member
Join Date: Oct 2004
Old 08-06-2005 , 15:06  
#49

Does this work for HL2DM?
Slayor is offline
zaqaz
New Member
Join Date: Oct 2005
Old 10-24-2005 , 22:35  
#50

Can anybody tell me ifthis project is still alive?
I'm planning to develop some scripts, but curious about project future.
zaqaz is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode