Author Topic: Need some help with a couple of things  (Read 1290 times)

/title
1. How could I detect when a player spraypaints another player, and find the sprayer and victim?
2. How can I use eval to change variables in server.cs files?
3. How can I find the object ID of players easily by using a console command?
4. How can I call a function when a player chats without breaking the chat (which i did once before- nobody could chat)
All help is appreciated. Also, if someone wouldn't mind me asking them questions about coding through steam, please tell me so. Thanks.
Im starting to learn the basics and am rapidly learning TS eeee

/title
1. How could I detect when a player spraypaints another player, and find the sprayer and victim?
2. How can I use eval to change variables in server.cs files?
3. How can I find the object ID of players easily by using a console command?
4. How can I call a function when a player chats without breaking the chat (which i did once before- nobody could chat)
1. theres a function for when the spraycan fires, which also returns a client and whatever it hit. if someone can get that itd be nice
2. you can change global variables with just
Code: [Select]
$variable = "lol";but you cant change temporary ones
3. i dont know this one
4.
Code: [Select]
function servercmdMessageSent(%this, %msg){
parent::servercmdMessageSent(%this, %msg)
if(%msg $= "lol"){
function();
}
}

#3:
Code: [Select]
talk(findClientByName(%name).player);

/title
1. How could I detect when a player spraypaints another player, and find the sprayer and victim?
2. How can I use eval to change variables in server.cs files?
3. How can I find the object ID of players easily by using a console command?
4. How can I call a function when a player chats without breaking the chat (which i did once before- nobody could chat)
All help is appreciated. Also, if someone wouldn't mind me asking them questions about coding through steam, please tell me so. Thanks.
Im starting to learn the basics and am rapidly learning TS eeee


#1: Use trace: http://forum.blockland.us/index.php?topic=191941.0
#2: You can temporarily change them easily ( $$varname = something; ), but to change them inside of the .cs file, it'd be a little more difficult with eval.
#3: findclientbyname(clientName).player
#4: See #1

Code: [Select]
function servercmdMessageSent(%this, %msg){
parent::servercmdMessageSent(%this, %msg)
if(%msg $= "lol"){
function();
}
}
Don't use this, Setro. It breaks the chat. Just do what elm said.

Don't use this, Setro. It breaks the chat. Just do what elm said.
No it won't. I won't even execute because it has a syntax error. And even then, why would it break the chat?

No it won't. I won't even execute because it has a syntax error. And even then, why would it break the chat?
Because there's no package

Because there's no package
Oh yeah. Didn't think of that. Just woke up.

Thanks. I know what trace does but I've never really used it that way before.