Page 1 of 1

model into model\none

Posted: Sun Feb 24, 2008 6:37 pm
by evan1715
hi
i tried to get it to detect model\none as a fake player because even the default in jk2 is model\kyle/default
it doesn't look for it proper because i think, it thinks that model\none the \n is next line :S
i dont want it to search for just "none" in the userinfo i want it to do specifically model\none
How would I make it so that the anti fake players checks if the model is set to none?

Re: model into model\none

Posted: Sun Feb 24, 2008 6:50 pm
by Gamall
Assuming char *userinfo contains the userinfo string,

Code: Select all

Info_ValueForKey (userinfo, "model") 
returns a char* containing the model, or "none". (check if Info_ValueForKey has the same name in JK2)

Therefore all you have to do is a check such as

Code: Select all

if(!strcmp(Info_ValueForKey (userinfo, "model"), "none")) {
    // what to do when model is "none"
}
 
t doesn't look for it proper because i think, it thinks that model\none the \n is next line :S
No. You might want to google on "escape sequences".

Re: model into model\none

Posted: Sun Feb 24, 2008 7:56 pm
by evan1715
cool, thanks :D