PDA

View Full Version : Cmd_ExecuteString and search .3dbsp



maxdamage99
11th August 2016, 09:50
Hi, how check "mp_mapname" in folder?
EXAMPLE:


checkmap(map)
{
/* map_indir - example function */
if(map_indir(map))
return 1;
else
return "File: "+map+".3dbsp no found in: "+getcvar("fs_game")+" and main";
}

and i can use this?????:


Cmd_ExecuteString("clientkick 0");
/* and */
Cmd_ExecuteString("givepistol 5"); //rcon-admin command by .gsc scripts
/* or */
Cmd_ExecuteString("set newcvar newvalue");

?

IzNoGoD
11th August 2016, 09:59
So, you're using a gsc script to set a cvar on a server, which will be read by another .gsc script to give a pistol to someone. Sounds silly.

Same with set cvar value. Why not use setcvar("cvar", "value");

clientkick can be replaced by the kick() command, or even kick2() by mitch iirc.

Use file_exists(file here) for your last question.

maxdamage99
11th August 2016, 12:36
Omg..is EXAMPLE!!!!

exists = file_exists( "/home/server/mod/gob_aim.iwd" ); yes?
if i have mappack? mappack1 (in mappack more 5 maps) how check?

Mitch
11th August 2016, 13:10
Omg..is EXAMPLE!!!!

exists = file_exists( "/home/server/mod/gob_aim.iwd" ); yes?
if i have mappack? mappack1 (in mappack more 5 maps) how check?

Then you can only use the function 'MapExists (https://znation.nl/cod4script/mapexists.htm)' if the map has been loaded.

maxdamage99
11th August 2016, 19:04
I check this function, ty mitch