View previous topic :: View next topic |
Author |
Message |
Ran
Joined: 05 Mar 2009 Posts: 3
|
Posted: Thu Mar 05, 2009 4:20 pm Post subject: Storing player values that isn't reset on spawn |
|
|
Hello! A beginner QC programmer here. I'm trying to make a small lan unmod with two different classes (one is supposed to hunt the other one). But everytime a player dies they lose their class in some way.
I started by using the class guide found on this site.
How do I change this? It's probably really easy. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Thu Mar 05, 2009 4:53 pm Post subject: |
|
|
Simple: don't reset it!
You can use the parms stuff to transfer per-player info between levels. But that's not needed when you're not changing level, as those fields are only cleared if you clear them (or the player disconnects). _________________ What's a signature? |
|
Back to top |
|
 |
Ran
Joined: 05 Mar 2009 Posts: 3
|
Posted: Thu Mar 05, 2009 5:09 pm Post subject: |
|
|
Hm, okay. Weird, I've searched trough all code for ".classtype = ", but I never change that to any other value than my class value.
Whenever I respawn, the players .classtype will change to 0. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Thu Mar 05, 2009 5:57 pm Post subject: |
|
|
Well in which function do you set it? And do you set it to what its meant to be at that point? _________________ What's a signature? |
|
Back to top |
|
 |
Ran
Joined: 05 Mar 2009 Posts: 3
|
Posted: Thu Mar 05, 2009 6:55 pm Post subject: |
|
|
I set it in two places. First in weapons as an impulse, second in client in ClientObituary().
I set it to the right value, everything works out (I lose my weapon just like you are supposed to, and weapon damage is changed etc. just like it's coded), the only problem is that when I respawn I lose my classtype. |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Wed Mar 11, 2009 12:12 am Post subject: |
|
|
What might be happening is that you're not reading it properly when the player respawns. |
|
Back to top |
|
 |
|