PDA

View Full Version : When installing libcod, nothing works!



maxdamage99
8th August 2015, 12:28
Install libcod for server cod2 1.3;
It does not work nothing is happening periodically. What is the problem?
waittillframeend;It is everywhere
After standing in self ClientCommand ();917

kung foo man
8th August 2015, 14:41
Not sure, but I guess you use ClientCommand() but don't call the original function then. Can you post your callback code?

maxdamage99
8th August 2015, 15:23
Private Message kung

Tally
8th August 2015, 16:16
Private Message kung

Why start a thread in the forums if you are going for Private Messages? Shall I delete this thread?

maxdamage99
8th August 2015, 18:07
Your solve Tally, I do not care!

IzNoGoD
8th August 2015, 18:33
I'm pretty sure kung would post the code + fix here when he receives it. Keep the thread open for a bit :)

kung foo man
8th August 2015, 20:56
Cannot see the error at first look, so I just post the code (thx for: no formatting, hence lost tabs, missing startznach() function, non-english variable names, makes it easy lol):

For reference, working example: http://killtube.org/showthread.php?1201-Extension-Player-Command-Control-%28includes-CHAT-Control-for-Builtin-B3!%29



CodeCallback_PlayerCommand(args)
{
probel=" ";
itogargs="";
prefix=startznach("prefix");
cmdsay=startznach("cmdsay");
cmdsayteam=startznach("cmdsayteam");

args = fixChatArgs(args);

//for(i=0; i<args.size; i++) //лагает сервер
itogargs+=args[1]+probel;
if(args.size>2)
{ itogargs+=args[2]+probel; }
if(args.size>3)
{ itogargs+=args[3]+probel; }
if(args.size>4)
{ itogargs+=args[4]+probel; }
if(args.size>5)
{ itogargs+=args[5]+probel; }
if(args.size>6)
{ itogargs+=args[6]+probel; }
if(args.size>7)
{ itogargs+=args[7]+probel; }
if(args.size>8)
{ itogargs+=args[8]+probel; }
if(args.size>9)
{ itogargs+=args[9]+probel; }
if(args.size>10)
{ itogargs+=args[10]+probel; }
if(args.size>11)
{ itogargs+=args[11]+probel; }


if(args[0]==cmdsay && isDefined(args[1]) && args[1]!="qwertyu12345678")
{
waittillframeend;
self thread printmessage(args[0], itogargs, cmdsay, cmdsayteam, prefix);
return;
}
if(args[0]==cmdsayteam && isDefined(args[1]) && args[1]!="qwertyu12345678")
{
waittillframeend;
self thread printmessage(args[0], itogargs, cmdsay, cmdsayteam, prefix);
return;
}

self ClientCommand();
}

printmessage(komu, smska, cmdsay, cmdsayteam, prefix)
{
if(komu==cmdsay)
{
if(self getGuid()==706843)
{
waittillframeend;
sendGameServerCommand(-1, "h \"^2[^3Админ^2]^7"+ bezcveta(self.name) +"^7: " + smska + "\"");
}
else
{
waittillframeend;
sendGameServerCommand(-1, "h \"^2[^7Игрок^2]^7"+ bezcveta(self.name) +"^7: " + smska + "\"");
}
}
if(komu==cmdsayteam)
{
if(self getGuid()==706843)
{
komanda=self.pers["team"];
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
if(players[i].pers["team"]==komanda)
{
waittillframeend;
sendGameServerCommand(players[i] getEntityNumber(), "h \"^2[^3Админ^2] ^4[^5Команде^4]^7"+ bezcveta(self.name) +"^7: ^5" + smska + "\"");
}
}
else
{
komanda=self.pers["team"];
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
if(players[i].pers["team"]==komanda)
{
waittillframeend;
sendGameServerCommand(players[i] getEntityNumber(), "h \"^2[^7Игрок^2] ^4[^5Команде^4]^7"+ bezcveta(self.name) +"^7: ^5" + smska + "\"");
}
}
}
}

IzNoGoD
9th August 2015, 11:29
Imma guess that he didnt try with developer 1 yet?

maxdamage99
9th August 2015, 11:33
The error is not displayed

Tally
9th August 2015, 15:04
It's a timing issue - remove all the waittillframeends.

It's not a good idea to use any wait times while the game is loading and compiling.

maxdamage99
10th August 2015, 16:01
I put waittillframeends is not a long time, so it was up to waittillframeends

IzNoGoD
10th August 2015, 20:01
It's a timing issue - remove all the waittillframeends.

It's not a good idea to use any wait times while the game is loading and compiling.

The waittillframeend is actually needed if you respawn a client with this method (or wait 0.05 or any wait at all), but you should NEVER call the playercommand() function after a wait for the buffer in it will have been altered, resulting in undefined behaviour (http://www.catb.org/jargon/html/N/nasal-demons.html)

As the waittillframeend is properly return;-d, i dont see much issues with it. However, as there is obviously an issue with the code (see OP), i'd advise to remove all code and just do a self clientcommand() in the callback, nothing else. See how that goes and add stuff from there, until it crashes again.

tl;dr: debug using normal methods

maxdamage99
10th August 2015, 23:29
I rewrote the code does not once, did conceived in different ways, sometimes it turns out error, when you start card, monitor or predict its occurrence is not possible :(

IzNoGoD
11th August 2015, 00:40
I rewrote the code does not once, did conceived in different ways, sometimes it turns out error, when you start card, monitor or predict its occurrence is not possible :(

I know the words in this sentence but i cannot, at any rate, create a good story out of this


Basically similar to this: http://funnyjunk.com/channel/4chan/Under+water+weight+test/GeRBGTr/ but makes less sense even.