need help with level.getUserInfo
hello
i'm trying to do fps display for spectators in cod4 cj mod
the problem since 1.7a and 1.8x got removed from github i don't know the right syntax or what i need to do to get it working
so i copied a thread from another mod which has that functionality working fine
getMaxFPS()
{
self endon("disconnect");
return int(min(1000,int(self [[level.getUserInfo]]("com_maxfps"))));
}
i get this error
undefined is not a function pointer: (file 'addons/_fps.gsc', line 12)
return int(min(1000,int(self [[level.getUserInfo]]("com_maxfps"))));
*
what am i missing here ?
Posted on 23.03.2016 / 1:11
REPLIES
Missing a file or a function is wrong. Double check.
Posted on 23.03.2016 / 19:41
i did some digging and found out i'm missing a file which is ninja_serverfile.gsc
so i toke a look at it
init()
{
level.ninjaServerFile = true;
level.authorizeMode = getDvarInt("sv_authorizemode");
level.getGuid = ::_getGuid;
if(level.authorizeMode)
level.getGuid = ::_getUid;
level.setJumpHeight = ::_setJumpHeight;
level.getUserInfo = ::_getUserInfo;
}
_getUserInfo(arg)
{
return self getUserInfo(arg);
}
_getUid()
{
return self getUid();
}
_getGuid()
{
return self getGuid();
}
_setJumpHeight(x)
{
self setJumpHeight(x);
}
while i know the getuserinfo arg is empty i included it anyway and got this error
struct is not an entity: (file 'addons/ninja_serverfile.gsc', line 15)
return self getUserInfo(arg);
i'm still missing something
Posted on 23.03.2016 / 22:54
You can't just take things and hope them to work. These files are made for certain servers. Thou the error thing. The struct isn't being an entity. Which means it should be put in a game as a script_struct or something like this. If you really want to do some thing don't files. Ask scripters i'm sure they will help you.
Posted on 24.03.2016 / 7:45
i already answered
and no body helps or even sell scripts so i'm left dealing with this shit
- the 1.7a 1.8x removed from github
- cod4x website is dead and pretty much every post is about promod
- codjumper.com is dead i asked .. even pm'd most of coders there no one answered or helped
and level.getUserInfo isn't made for a specific mod it was introduced with 1.7a a long time ago
Posted on 24.03.2016 / 23:33
Post reply
ONLY USERS CAN POST REPLIES.