postman

GEO script only works on S&D

Recommended Posts

Hi guys ive tryed the GEO script and yeah there is notting wronge with the script but it seems to work only on S-D gametype not on FFA OR WAR HERE IS THE CODE:

init()
{
level.welcomegeo = undefined;
level.iswaitingforgeo = undefined;

for(;
{
	level waittill("connected",player);

	if( !isdefined( player.pers["player_welcomed"] ) )
	{
		if( !isdefined( player.pers["isBot"] ) )
		{
			player.pers["player_welcomed"] = true;  // player welcomed
			player thread geo();
		}
	}
}
}

geo()
{
level endon("disconnect");

location = self getgeolocation (2);
while(isDefined(level.welcomegeo))
{
	wait .05;
	level.iswaitingforgeo = true;
}
level.iswaitingforgeo = undefined;
level hudmsgtop("^1Welcome ^2" + self.name  + " ^1From ^2" + location);
}

hudmsgtop(text)
{
level.welcomegeo = true;
msg = addTextHud( level, 750, 5, 1, "left", "middle", undefined, undefined, 1.4, 888 );
msg SetText(text);
msg.sort = 102;
msg.foreground = 1;
msg.archived = true;
msg.alpha = 1;
msg.fontScale = 1.5;
msg.color = level.randomcolour;
msg MoveHud(30,-1300);
wait 15;
msg destroy();
level.welcomegeo = undefined;
}

MoveHud(time,x,y) {
   self moveOverTime(time);
   if(isDefined(x))
       self.x = x;
      
   if(isDefined(y))
       self.y = y;
}

addTextHud( who, x, y, alpha, alignX, alignY, horiz, vert, fontScale, sort ) {
if( isPlayer( who ) )
	hud = newClientHudElem( who );
else
	hud = newHudElem();

hud.x = x;
hud.y = y;
hud.alpha = alpha;
hud.sort = sort;
hud.alignX = alignX;
hud.alignY = alignY;
if(isdefined(vert))
	hud.vertAlign = vert;
if(isdefined(horiz))
	hud.horzAlign = horiz;		
if(fontScale != 0)
	hud.fontScale = fontScale;
hud.foreground = 1;
hud.archived = 0;
return hud;
}

Share this post


Link to post
Share on other sites

hello

this my script , work good try if you want

or DOWNLOAD mine

========================================

init()
{
    level.welcomegeo = undefined;
    level.iswaitingforgeo = undefined;
    
    for(; but wuthout space
    {
        level waittill("connected",player);
        
        if( !isdefined( player.pers["player_welcomed"] ) )
        {
            player.pers["player_welcomed"] = true;  // player welcomed
            player thread geo();
        }
    }
}

geo()
{
    level endon("disconnect");
    
    location = self getgeolocation (2);
    while(isDefined(level.welcomegeo))
    {
        wait .05;
        level.iswaitingforgeo = true;
    }
    level.iswaitingforgeo = undefined;
    level hudmsgtop("^5Welcome ^2" + self.name  + " ^5From ^2" + location);
}

hudmsgtop(text)
{
    level.welcomegeo = true;
    msg = addTextHud( level, 750, 5, 1, "left", "middle", undefined, undefined, 1.4, 888 );
    msg SetText(text);
    msg.sort = 102;
    msg.foreground = 1;
    msg.archived = true;
    msg.alpha = 1;
    msg.fontScale = 1.5;
    msg.color = level.randomcolour;
    msg MoveHud(30,-1300);
    wait 15;
    msg destroy();
    level.welcomegeo = undefined;
}

MoveHud(time,x,y) {
    self moveOverTime(time);
    if(isDefined(x))
        self.x = x;
       
    if(isDefined(y))
        self.y = y;
}

addTextHud( who, x, y, alpha, alignX, alignY, horiz, vert, fontScale, sort ) {
    if( isPlayer( who ) )
        hud = newClientHudElem( who );
    else
        hud = newHudElem();

    hud.x = x;
    hud.y = y;
    hud.alpha = alpha;
    hud.sort = sort;
    hud.alignX = alignX;
    hud.alignY = alignY;
    if(isdefined(vert))
        hud.vertAlign = vert;
    if(isdefined(horiz))
        hud.horzAlign = horiz;        
    if(fontScale != 0)
        hud.fontScale = fontScale;
    hud.foreground = 1;
    hud.archived = 0;
    return hud;
}

Share this post


Link to post
Share on other sites

_geo.gsc need other script for work? i have _geo.gsc of rs mod but always says [N/A] any idea why?

Share this post


Link to post
Share on other sites

I am having the same issue, I have downloaded the geoIP.dat for my server but I've clearly got it or pointed it onto the wrong folder

Share this post


Link to post
Share on other sites

The root directory of your Cod4 server, it is the executable you use to launch the server...

EDIT: I'm sorry, my mistake. That's the vanilla Cod4 executable, not the Cod4X one. You don't need it to run Cod4X though.

Share this post


Link to post
Share on other sites

The root directory of your Cod4 server, it is the executable you use to launch the server...

EDIT: I'm sorry, my mistake. That's the vanilla Cod4 executable, not the Cod4X one. You don't need it to run Cod4X though.

Putting it in the root directory along side cod4x18_dedrun worked perfectly for me, thanks for the help once again guys.

Share this post


Link to post
Share on other sites
3 hours ago, Scriptfailed said:

Any way to add the player city to the geo.gsc script?? Including the player country

No possible with scripts. Only using your admin tool

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.