PDA

View Full Version : CodeCallback_PlayerCommand(args) does not work



suck000
19th March 2016, 06:12
Hi , i was trying to add !kick command but it didn't work , i placed the .gsc file at moddirectory/maps/mp/gametypes , i restarted server to apply the changes but when am ingame , i do !kick but nothing appears :/ help me :p

// Callback Setup
// This script provides the hooks from code into script for the gametype callback functions.

//================================================== ===========================
// Code Callback functions

/*================
Called by code after the level's main script function has run.
================*/
CodeCallback_StartGameType()
{
// If the gametype has not beed started, run the startup
if(!isDefined(level.gametypestarted) || !level.gametypestarted)
{
[[level.callbackStartGameType]]();
level.gametypestarted = true; // so we know that the gametype has been started up
}
}

/*================
Called when a player begins connecting to the server.
Called again for every map change or tournement restart.

Return undefined if the client should be allowed, otherwise return
a string with the reason for denial.

Otherwise, the client will be sent the current gamestate
and will eventually get to ClientBegin.

firstTime will be qtrue the very first time a client connects
to the server machine, but qfalse on map changes and tournement
restarts.
================*/

CodeCallback_PlayerConnect()
{
self endon("disconnect");
[[level.callbackPlayerConnect]]();
}

/*================
Called when a player drops from the server.
Will not be called between levels.
self is the player that is disconnecting.
================*/
CodeCallback_PlayerDisconnect()
{
self notify("disconnect");
[[level.callbackPlayerDisconnect]]();
}

/*================
Called when a player has taken damage.
self is the player that took damage.
================*/
CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
{
self endon("disconnect");
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
}

/*================
Called when a player has been killed.
self is the player that was killed.
================*/
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
self endon("disconnect");
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
}

//================================================== ===========================

/*================
Setup any misc callbacks stuff like defines and default callbacks
================*/
SetupCallbacks()
{
SetDefaultCallbacks();

// Set defined for damage flags used in the playerDamage callback
level.iDFLAGS_RADIUS = 1;
level.iDFLAGS_NO_ARMOR = 2;
level.iDFLAGS_NO_KNOCKBACK = 4;
level.iDFLAGS_NO_TEAM_PROTECTION = 8;
level.iDFLAGS_NO_PROTECTION = 16;
level.iDFLAGS_PASSTHRU = 32;
}

/*================
Called from the gametype script to store off the default callback functions.
This allows the callbacks to be overridden by level script, but not lost.
================*/
SetDefaultCallbacks()
{
level.default_CallbackStartGameType = level.callbackStartGameType;
level.default_CallbackPlayerConnect = level.callbackPlayerConnect;
level.default_CallbackPlayerDisconnect = level.callbackPlayerDisconnect;
level.default_CallbackPlayerDamage = level.callbackPlayerDamage;
level.default_CallbackPlayerKilled = level.callbackPlayerKilled;
}

/*================
Called when a gametype is not supported.
================*/
AbortLevel()
{
println("Aborting level - gametype is not supported");

level.callbackStartGameType = ::callbackVoid;
level.callbackPlayerConnect = ::callbackVoid;
level.callbackPlayerDisconnect = ::callbackVoid;
level.callbackPlayerDamage = ::callbackVoid;
level.callbackPlayerKilled = ::callbackVoid;

setcvar("g_gametype", "dm");

exitLevel(false);
}

/*================
================*/
callbackVoid()
{
}


fixChatArgs(args)
{
if (isDefined(args[1])) { // engine is adding identifier infront of the chat message
if (getAscii(args[1][0]) >= 20 && getAscii(args[1][0]) <= 22) {
args[1] = getSubStr(args[1], 1);
newArgs = strTok(args[1], " ");
for (i=0; i<newArgs.size; i++)
args[1+i] = newArgs[i];
}
}
return args;
}


checkIfExist(number)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] getentitynumber() == Int(number))
return true;
}
return false;
}

thirdArgument(args)
{
text = "";
for(i=3; i<args.size; i++)
text += args[i] + " ";
return text;
}

getPlayerNameById(number)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] getentitynumber() == Int(number))
return players[i].name;
}
return false;
}

getPlayerById(number)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] getEntityNumber() == Int(number))
return players[i];
}
return false;
}

tellMessage(message)
{
sendgameservercommand(self getentitynumber(), "h \"^7console: ^7" + message + "\"");
}


tellMessageWorld(message)
{
sendgameservercommand(-1, "h \"^7console: ^7" + message + "\"");
}

isint(string)
{
return ((int(string) + "") == string + "");
}


CodeCallback_PlayerCommand(args)
{
output = "";
for (i=0; i<args.size; i++)
output += args[i] + ", ";

args = fixChatArgs(args);


if (args[0] == "say" && isDefined(args[1]) && args[1][0] == "!")
{
switch (getSubStr(args[1], 1))
{
case "kick":
if(self getGUID() == "707051")
{
if (isDefined(args[2]) && isint(args[2]) && isDefined(args[3]))
{
args[2] = int(args[2]);
if(!checkIfExist(args[2]))
{
self thread tellMessage("Couldn\'t find a player with this number.");
return;
}
args[3] = thirdArgument(args);
kickmsg = "You were kicked, because of reason: " + args[3];
tokickname = getPlayerNameById(args[2]);
thread tellMessageWorld(tokickname + " ^7was kicked. Reason: " + args[3]);
kick2(args[2], kickmsg);
return;
}
else
{
self thread tellMessage("Noone to kick, or no reason typed ._.");
return;
}
}
else
{
self thread tellMessage("You are not an admin.");
return;
}
}
}

self ClientCommand();
}

kung foo man
19th March 2016, 08:09
How did you install libcod?

Renamed from "How to do this ?" to "CodeCallback_PlayerCommand(args) does not work"

suck000
19th March 2016, 08:12
It is not installed , idk how i install it , i just got the code from a friend , and he told me to put it in that directory and kick command will work. But server crash when i put it.

Any help ?

suck000
19th March 2016, 08:15
My server is hosted on linux ubtunu , i got End map vote , and it is working fine , but this script won't work ... I really want to learn how to install " libcod " and how to make a script working because am tired for asking ppl how & how & how .. + ppl never help me , none has done since i came atleast :p

suck000
19th March 2016, 08:22
See ? i reply someone with my problem , and he never answers again.
GG

kung foo man
19th March 2016, 08:25
Install howto: https://github.com/kungfooman/libcod/

(https://github.com/kungfooman/libcod/)The world doesn't rotate around you, even if your spoiled brain might think that.

IzNoGoD
19th March 2016, 08:52
Could be you got another mod installed, with a _callbacksetup in an iwd file, which will overwrite the one outside the iwd file (the one you made the modifications to)

suck000
19th March 2016, 09:01
Well , i have 2 iwd mods placed on main , they could affect ?

IzNoGoD
19th March 2016, 09:43
You are giving very little information to begin with

All you're basically saying is: i painted the fence red and the dog doesnt like it.

This doesnt give us information about
1) wether or not your dog can see colors
2) if the paint is still wet
3) if the paint still smells
4) if there's a bear behind the fence which the dog might be afraid of
5) anything vacuum-cleaner related

To translate the above into your question, could you confirm that
1) you have libcod installed properly
2) which version of libcod you have installed
3) does your libcod version match your cod version
4) which mods you are running
5) what script files are inside those mods
6) what error your server crashes with
etcetera.

IzNoGoD
19th March 2016, 09:49
Install howto: https://github.com/kungfooman/libcod/

(https://github.com/kungfooman/libcod/)The world doesn't rotate around you, even if your spoiled brain might think that.

What kung is saying: You posted 3 comments within 10 minutes, expecting IMMEDIATE help WITHOUT providing ANY details about your problem AT ALL.

"ye someone else installed it idk" does NOT answer any question (aside from questions about your capabilities), and then go on to bash EVERYONE on this forum that happened to not respond to your question in the beforementioned 10 minutes.

This. isnt. facebook.

This is a forum, where people occasionally come, check for new posts, and where they might reply in case they would like to do so.
Giving people shit for not instantly responding is not going to help your case, and neither is showing the greatest amount of ignorance towards stuff you installed.

IzNoGoD
19th March 2016, 09:50
Well , i have 2 iwd mods placed on main , they could affect ?

As I told you, word for word, in the post right above this one, it COULD affect your shit IF the iwd files contain the _callbacksetup.gsc file which will overwrite the ones outside the iwd files.

Given your response, i feel you have not checked this (and maybe do not know how to check this), and should maybe try some easier mods first before you go into libcod.

IzNoGoD
19th March 2016, 10:01
Also, please stop spamming my over PM about your problems. As mentioned before, the world doesnt revolve around you getting your answer within 10 minutes.



On a more on-topic note: why are you doing


kick2(args[2], kickmsg);

when kick2 takes an int and a string as arguments? This will most likely be the cause of your crash, which you might have been able to tell us if you followed the following procedure:
https://killtube.org/showthread.php?1740-READ-BEFORE-POSTING-Guide-on-asking-for-help

which is a sticky thread in this very subforum.

suck000
19th March 2016, 10:03
OK !

I don't have libcod istalled , i use this : tmux new-session -d -s codserver "./cod2 +set fs_game mod +exec server.cfg"

I pasted the .gsc file directly to moddir/maps/mp/gametypes.

I tried to test it , did not work !

My question is : HOW I MAKE THAT SCRIPT WORKS

WHAT IS LIBCOD ?

WHY I HAVE TO INSTALL IT , HOW TO INSTALL IT (STEP BY STEP)

HOW TO START MY COD2 SERVER WITH THIS LIBCOD AND MAKE MY SCRIPT WORK

I think it is CLEAR now. Thank you.

EDIT : Dude i didn't write that script. I got it from a friend ok ? Idk anything on scripting , idk how to do a code either.

Whiskas
19th March 2016, 10:22
Also, please stop spamming my over PM about your problems. As mentioned before, the world doesnt revolve around you getting your answer within 10 minutes.



On a more on-topic note: why are you doing


kick2(args[2], kickmsg);

when kick2 takes an int and a string as arguments?

Few lines above


args[2] = int(args[2]);

IzNoGoD
19th March 2016, 10:37
OK !

I don't have libcod istalled , i use this : tmux new-session -d -s codserver "./cod2 +set fs_game mod +exec server.cfg"

I pasted the .gsc file directly to moddir/maps/mp/gametypes.

I tried to test it , did not work !

My question is : HOW I MAKE THAT SCRIPT WORKS

WHAT IS LIBCOD ?

WHY I HAVE TO INSTALL IT , HOW TO INSTALL IT (STEP BY STEP)

HOW TO START MY COD2 SERVER WITH THIS LIBCOD AND MAKE MY SCRIPT WORK

I think it is CLEAR now. Thank you.

EDIT : Dude i didn't write that script. I got it from a friend ok ? Idk anything on scripting , idk how to do a code either.


You still didnt provide
1) you have libcod installed properly
2) which version of libcod you have installed
3) does your libcod version match your cod version
4) which mods you are running
5) what script files are inside those mods
6) what error your server crashes with

1-2-3 seems to be somewhat answerred, by the fact that you provided your startup line, which doesnt seem to contain any libcod-related stuff

So why are you saying that your friend installed libcod? Very confusing

Also, using this script without having libcod installed will result in a crash, as stock cod2 does not know how to handle the kick2() function.

Moreover, you have been provided with a how-to-install-libcod on multiple occasions (1. there's a link to the github on the main page of this forum 2. kung posted a link to that github in this topic 3. i sent you a PM containing a "how to install libcod on ubuntu 14.04" tutorial)

So please, put in some effort, and dont expect us to magically fix your problems when you do not even have the right equipment for this shit.

It's like asking us "why cant i dig a tunnel with this shovel" while standing on solid rock.

IzNoGoD
19th March 2016, 10:45
OK !

I don't have libcod istalled , i use this : tmux new-session -d -s codserver "./cod2 +set fs_game mod +exec server.cfg"

This doesnt contain any libcod info


I pasted the .gsc file directly to moddir/maps/mp/gametypes.

yes, thats where it should go


I tried to test it , did not work !

with what error did it crash



My question is : HOW I MAKE THAT SCRIPT WORKS

probably install libcod + apply the fix wiskas extracted from my rage-comment


WHAT IS LIBCOD ?

to quote the github you've been provided a link to:


The Call of Duty extension libcod is adding new server-side functions to:

Call Of Duty 2 1.2
Call Of Duty 2 1.3
Call Of Duty 4 1.7




WHY I HAVE TO INSTALL IT
well, to, again, quote the github:


The Call of Duty extension libcod is adding new server-side functions to:

Call Of Duty 2 1.2
Call Of Duty 2 1.3
Call Of Duty 4 1.7



, HOW TO INSTALL IT (STEP BY STEP)

from the github:


Requirements:

dpkg --add-architecture i386
apt-get update
apt-get install gcc-multilib
apt-get install libmysqlclient-dev:i386
apt-get install g++-multilib

Precompiled shared libraries: http://killtube.org/downloads/libcod/

Starting the server:

LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded +set fs_game ...

Some enviroments need LD_LIBRARY_PATH also:

LD_LIBRARY_PATH=. LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded +set fs_game ...
or from my tutorial which i sent you by pm:


Step 4 (optional): Installing libcod prerequisites
As copied from the libcod github:


sudo apt-get -y install gcc-multilib
sudo apt-get -y install libmysqlclient-dev:i386
sudo apt-get -y install g++-multilib

I've tried installing these all in one command, but that failed for some unknown reasons. So just keep these as separate commands.

Step 5 (optional): compiling libcod from source
In order to compile libcod, you first need to obtain the source code. There are currently multiple libcod versions out there:
Kung foo man's original version (https://github.com/kungfooman/libcod)
Mitch's version (https://github.com/M-itch/libcod) which is a bit more experimental and has a few more features than the original version
Php's version (https://github.com/riicchhaarrd/libcod) has a few nice functions but seems to be out-of-date
voron00's version (https://github.com/voron00/libcod) which seems to be the best maintained version currently

To obtain the code, either download the source from github and upload, or


sudo apt-get install git
git clone [github url here]


You can then easily compile the stuff with


./doit.sh clean
./doit.sh base
./doit.sh cod2_1_3

For different cod versions, change the last line.
The final product (the actual libcod "executable") is then inside the bin folder as libcod2_1_3.so


HOW TO START MY COD2 SERVER WITH THIS LIBCOD
from the tutorial in the pm:


Step 7 (optional): Starting your CoD2 server with libcod
Requires a few small edits to your .sh file:


#!/bin/bash

sv_maxclients="32"
fs_game="your_mod_folder_here"
fs_homepath="/home/USER_HERE/YOUR_COD_DIR"
cod="/full/path/to/cod2_1_3_lnxded"
com_hunkMegs="256"
config="configfile.cfg"
cracked="1"
net_port="28960"


args=\
"+set fs_homepath \"$fs_homepath\" "\
"+set sv_cracked $cracked "\
"+set fs_game $fs_game "\
"+set net_port $net_port "\
"+set com_hunkMegs $com_hunkMegs "\
"+set sv_maxclients $sv_maxclients "\
"+set fs_basepath \"$fs_homepath\" "\
"+exec $config"

LD_PRELOAD="relative/path/to/libcod2_1_3.so" $cod $args +set g_gametype tdm +map mp_toujane


AND MAKE MY SCRIPT WORK
add the fixes by wiskas.



I think it is CLEAR now. Thank you.

I agree it's very clear on how to do this.


EDIT : Dude i didn't write that script. I got it from a friend ok ?
Maybe ask your friend to fix the script he wrote, instead of complaining about a third-party forum not instantly helping you, chewing all the bits for you and helping you swallow.

Idk anything on scripting , idk how to do a code either.
maybe this is not for you then...

IzNoGoD
19th March 2016, 11:45
whiskas just told me that the line he quoted isnt a fix: its already in the code.

So the crash is most likely caused by you using the kick2() command without having libcod installed

Note: changing it to kick() wont help you. Although it stops the code from crashing, there is no way for the code to be called without libcod installed.

suck000
19th March 2016, 11:53
I installed libcod and i have a problem , i am stuck at step 6.
I started cod2 server with libcod and everything ok. But how i'll keep it running ??? Any commands for that ? i tried screen didn't work i think.
screen command is for server without libcod. But mine is with , what to do ? If tmux command is running can you give me how to write it ?

voron00
19th March 2016, 12:04
I installed libcod and i have a problem , i am stuck at step 6.
I started cod2 server with libcod and everything ok. But how i'll keep it running ??? Any commands for that ? i tried screen didn't work i think.
screen command is for server without libcod. But mine is with , what to do ? If tmux command is running can you give me how to write it ?

The easiest way is proably to create a simple shell script (name it 'myserver.sh'), put in your cod2 dir and then launch it from the screen e.g 'screen sh myserver.sh'


#!/bin/bash

export LD_PRELOAD="$HOME/cod2_1_0/libcod2_1_0.so" # Point to your lib

PARAMS="+set fs_game myserver +set dedicated 2 +set net_port 28960 +exec config.cfg" # Your server launch options

"./cod2_lnxded" "$PARAMS"

exit 1

IzNoGoD
19th March 2016, 12:13
Read the tutorial again, it explains EXACTLY how to run a file in screen in step 6.
In step 7 it lists some changes to your .sh file in order to add libcod. THIS DOES NOT MAKE THE SCREEN COMMANDS IN STEP 6 INVALID.

And


i tried screen didn't work i think.

is by far the worst bug report i've seen in my life.

suck000
19th March 2016, 12:15
But if VPS electricity shuts down , i want to keep my server running. There is a background job of course.

And when i rebooted my machine , server was gone. I really don't want to ./start.sh everytime. Is there a fix for that ?

Aa and plz with commands :p

EDIT : What is that " screen -AmdS "SOMENAME" ??

What is somename ?

IzNoGoD
19th March 2016, 12:52
somename is some name.
you decide what you name your screen session.



But if VPS electricity shuts down , i want to keep my server running
perpetuum mobile much?

And after a reboot your server will ofcourse be shut down. google "crontab" for possible solutions to that.

kung foo man
19th March 2016, 13:17
Restarting the CoD2 server on reboot is step 12 of Whiskas tutorial, which you sent me per PM: http://www.whiskaskitler.xyz/index.php/2016/02/28/your-first-call-of-duty-2-server-with-vps-not-for-the-pros/

suck000
19th March 2016, 13:54
Horaaaaaaaaaaaaaaaaaaaaaaay ! everything is good am running my server with libcod now !

And let's go the next next part ! How to load a .gsc (script) like the !kick command that i already linked to the post !

suck000
19th March 2016, 14:10
Libcod installed ! Server started too ! I have a problem now with the script , when i try !kick i go this error :

Script runtime error (see console for details)

"File maps/mp/gametype/_callbacksetup.gsc/" Line 200.

(Am using the script that i already linked before.)

suck000
19th March 2016, 14:19
Please fix the script for me <3

// Callback Setup
// This script provides the hooks from code into script for the gametype callback functions.

//================================================== ===========================
// Code Callback functions

/*================
Called by code after the level's main script function has run.
================*/
CodeCallback_StartGameType()
{
// If the gametype has not beed started, run the startup
if(!isDefined(level.gametypestarted) || !level.gametypestarted)
{
[[level.callbackStartGameType]]();
level.gametypestarted = true; // so we know that the gametype has been started up
}
}

/*================
Called when a player begins connecting to the server.
Called again for every map change or tournement restart.

Return undefined if the client should be allowed, otherwise return
a string with the reason for denial.

Otherwise, the client will be sent the current gamestate
and will eventually get to ClientBegin.

firstTime will be qtrue the very first time a client connects
to the server machine, but qfalse on map changes and tournement
restarts.
================*/

CodeCallback_PlayerConnect()
{
self endon("disconnect");
[[level.callbackPlayerConnect]]();
}

/*================
Called when a player drops from the server.
Will not be called between levels.
self is the player that is disconnecting.
================*/
CodeCallback_PlayerDisconnect()
{
self notify("disconnect");
[[level.callbackPlayerDisconnect]]();
}

/*================
Called when a player has taken damage.
self is the player that took damage.
================*/
CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
{
self endon("disconnect");
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
}

/*================
Called when a player has been killed.
self is the player that was killed.
================*/
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
self endon("disconnect");
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
}

//================================================== ===========================

/*================
Setup any misc callbacks stuff like defines and default callbacks
================*/
SetupCallbacks()
{
SetDefaultCallbacks();

// Set defined for damage flags used in the playerDamage callback
level.iDFLAGS_RADIUS = 1;
level.iDFLAGS_NO_ARMOR = 2;
level.iDFLAGS_NO_KNOCKBACK = 4;
level.iDFLAGS_NO_TEAM_PROTECTION = 8;
level.iDFLAGS_NO_PROTECTION = 16;
level.iDFLAGS_PASSTHRU = 32;
}

/*================
Called from the gametype script to store off the default callback functions.
This allows the callbacks to be overridden by level script, but not lost.
================*/
SetDefaultCallbacks()
{
level.default_CallbackStartGameType = level.callbackStartGameType;
level.default_CallbackPlayerConnect = level.callbackPlayerConnect;
level.default_CallbackPlayerDisconnect = level.callbackPlayerDisconnect;
level.default_CallbackPlayerDamage = level.callbackPlayerDamage;
level.default_CallbackPlayerKilled = level.callbackPlayerKilled;
}

/*================
Called when a gametype is not supported.
================*/
AbortLevel()
{
println("Aborting level - gametype is not supported");

level.callbackStartGameType = ::callbackVoid;
level.callbackPlayerConnect = ::callbackVoid;
level.callbackPlayerDisconnect = ::callbackVoid;
level.callbackPlayerDamage = ::callbackVoid;
level.callbackPlayerKilled = ::callbackVoid;

setcvar("g_gametype", "dm");

exitLevel(false);
}

/*================
================*/
callbackVoid()
{
}


fixChatArgs(args)
{
if (isDefined(args[1])) { // engine is adding identifier infront of the chat message
if (getAscii(args[1][0]) >= 20 && getAscii(args[1][0]) <= 22) {
args[1] = getSubStr(args[1], 1);
newArgs = strTok(args[1], " ");
for (i=0; i<newArgs.size; i++)
args[1+i] = newArgs[i];
}
}
return args;
}


checkIfExist(number)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] getentitynumber() == Int(number))
return true;
}
return false;
}

thirdArgument(args)
{
text = "";
for(i=3; i<args.size; i++)
text += args[i] + " ";
return text;
}

getPlayerNameById(number)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] getentitynumber() == Int(number))
return players[i].name;
}
return false;
}

getPlayerById(number)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(players[i] getEntityNumber() == Int(number))
return players[i];
}
return false;
}

tellMessage(message)
{
sendgameservercommand(self getentitynumber(), "h \"^7console: ^7" + message + "\"");
}


tellMessageWorld(message)
{
sendgameservercommand(-1, "h \"^7console: ^7" + message + "\"");
}

isint(string)
{
return ((int(string) + "") == string + "");
}


CodeCallback_PlayerCommand(args)
{
output = "";
for (i=0; i<args.size; i++)
output += args[i] + ", ";

args = fixChatArgs(args);


if (args[0] == "say" && isDefined(args[1]) && args[1][0] == "!")
{
switch (getSubStr(args[1], 1))
{
case "kick":
if(self getGUID() == "707051")
{
if (isDefined(args[2]) && isint(args[2]) && isDefined(args[3]))
{
args[2] = int(args[2]);
if(!checkIfExist(args[2]))
{
self thread tellMessage("Couldn\'t find a player with this number.");
return;
}
args[3] = thirdArgument(args);
kickmsg = "You were kicked, because of reason: " + args[3];
tokickname = getPlayerNameById(args[2]);
thread tellMessageWorld(tokickname + " ^7was kicked. Reason: " + args[3]);
kick2(args[2], kickmsg);
return;
}
else
{
self thread tellMessage("Noone to kick, or no reason typed ._.");
return;
}
}
else
{
self thread tellMessage("You are not an admin.");
return;
}
}
}

self ClientCommand();
}

The problem is at line 200.

IzNoGoD
19th March 2016, 15:11
post full error.

Try reading this:
https://killtube.org/showthread.php?1740-READ-BEFORE-POSTING-Guide-on-asking-for-help

suck000
19th March 2016, 16:36
mmm , see the attachment (image) i think that is the error.

IzNoGoD
19th March 2016, 17:26
no, i need the error server-side, not clientside.

It doesnt even mention line 200 in that image.

suck000
19th March 2016, 17:28
It does , i saw that yellow color , thought that is the error :p it mentions the line 200 when i press TAB too.

Wait am gonna give u the server side error.

suck000
19th March 2016, 18:04
I can't get server side error.

suck000
19th March 2016, 19:04
" Hey , wake up "

kung foo man
19th March 2016, 19:06
Post the output of: screen -ls (implying you don't know how to get into your CoD2 screen session)

suck000
19th March 2016, 19:14
No sockets found in /var/run/screen/S-codserver

suck000
19th March 2016, 19:15
please can u iznogod or kung foo come teaviewer and just fix it ffs

i woke up 5 am and it is 9 pm and i did not resolve any problem.
please

voron00
19th March 2016, 19:27
Change

if(self getGUID() == "707051")
To

if(self getGUID() == 707051)

That is all.

IzNoGoD
19th March 2016, 19:47
i tried screen didn't work i think.

is by far the worst bug report i've seen in my life.


I can't get server side error.

New winner.

suck000
19th March 2016, 20:03
Thanks voron ! worked :DDDDDDD

suck000
19th March 2016, 20:04
I want to thank kung foo man for coming TV and helping me out.

IzNoGod for being suck a rage friend <3 GOTCHA <3

Vorono for the great fix <3

suck000
19th March 2016, 21:12
I got a problem , when i off my VPS , server goes off and that is normal
When my VPS is ON again , my cod2 server doesn't starts automaticly. Is there a way for AUTO-RESTART it ?
I Have cod2 installed with libcod , i don't think that TMUX will work and if it does , tell me how !

Thanks !

IzNoGoD
19th March 2016, 21:15
I got a problem , when i off my VPS , server goes off and that is normal
When my VPS is ON again , my cod2 server doesn't starts automaticly. Is there a way for AUTO-RESTART it ?
I Have cod2 installed with libcod , i don't think that TMUX will work and if it does , tell me how !

Thanks !


Restarting the CoD2 server on reboot is step 12 of Whiskas tutorial, which you sent me per PM: http://www.whiskaskitler.xyz/index.php/2016/02/28/your-first-call-of-duty-2-server-with-vps-not-for-the-pros/


Literally IN THIS VERY THREAD. Learn to read.

suck000
20th March 2016, 05:58
Is it possible to run TMUX with libcod ?

Mitch
20th March 2016, 07:27
Is it possible to run TMUX with libcod ?

https://killtube.org/showthread.php?1971-How-to-use-libcod-with-Open-Game-Panel-(OGP)&p=10190&viewfull=1#post10190
This trick will work without changing your command line.

suck000
20th March 2016, 08:11
i did not understand. Would you give me the complete code to just place it directly ?

Mitch
20th March 2016, 08:15
mitch@znation:/path/to/cod2$ ls
cod2_lnxded main pb
cod2_lnxded_1_3_nodelay_va_loc miles ZN

mitch@znation:/path/to/cod2$ cat cod2_lnxded
#!/bin/bash
LD_PRELOAD="/path/to/cod2/libs/libcod2_1_3.so" ./cod2_lnxded_1_3_nodelay_va_loc $@

suck000
20th March 2016, 09:16
Mitch, it didn't work :S

Mitch
20th March 2016, 09:29
Mitch, it didn't work :S

Did you just copy and paste it or modified it to your situation?
If you modified it, please post your version.
Otherwise change it to your situation.

Edit: Also test it without tmux.

suck000
20th March 2016, 09:37
I modified it.
I have 1.0 version so i don't have cod2_lnxded_1_3_nodelay_va_loc.

I am not understanding alot. If you can come teamviewer , i'll be glad.
thanks mitchy

IzNoGoD
20th March 2016, 10:55
I modified it.
I have 1.0 version so i don't have cod2_lnxded_1_3_nodelay_va_loc.

I am not understanding alot. If you can come teamviewer , i'll be glad.
thanks mitchy

http://www.reactiongifs.us/wp-content/uploads/2013/10/shoo_pirates_caribbean.gif
You're an idiot.

maxdamage99
19th April 2016, 18:42
You realy?
CALLBACKSETUP DIR: fs_game/maps/mp/gametypes/
PLS CHECK!!?!?!?!?!??!