Author Topic: Noob to Scripting...  (Read 1078 times)

0 Members and 1 Guest are viewing this topic.

Offline Sinistersedge

  • Major(1)
  • Posts: 12
Noob to Scripting...
« on: September 16, 2009, 07:00:29 am »
Just want a Script that will make me able to have my Server put out my Clans website and Welcome to UaF Dedicated Server....any help would be much appreciated
http://unitedalliedforces.webs.com/




}UaF{ Server 68.186.149.97 port 23073

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Noob to Scripting...
« Reply #1 on: September 16, 2009, 09:31:01 am »
Code: (pascal) [Select]
procedure AppOnIdle(Ticks: integer);
begin
    if Ticks mod (3600 * 5) = 0 then begin
        WriteConsole(0, 'Welcome to UaF Dedicated Server', $FFFFFF);
        WriteConsole(0, 'Clan''s website here', $FFFFFF);
    end;
end;
That will print out those two messages every 5 minutes to everyone in the server.
« Last Edit: September 16, 2009, 04:59:12 pm by iDante »

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Noob to Scripting...
« Reply #2 on: September 16, 2009, 10:42:14 am »
Failing to compile != printing out two messages every 5 minutes.

(Second WriteConsole needs more 's, maybe I should say.)
« Last Edit: September 16, 2009, 10:44:15 am by GSx_Major »
...and headbutt the sucker through your banana suit!

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Re: Noob to Scripting...
« Reply #3 on: September 16, 2009, 12:02:23 pm »
Failing to compile != printing out two messages every 5 minutes.

(Second WriteConsole needs more 's, maybe I should say.)

Code: (pascal) [Select]
procedure AppOnIdle(Ticks: integer); 
begin 
  if Ticks mod (3600 * 5) = 0 then begin 
    WriteConsole(0, 'Welcome to UaF Dedicated Server', $FFFFFF); 
    WriteConsole(0, 'Clan''s website here', $FFFFFF); 
  end; 
end; 
Soldat Global Account System: #soldat.sgas @ quakenet

Offline Sinistersedge

  • Major(1)
  • Posts: 12
Re: Noob to Scripting...
« Reply #4 on: September 16, 2009, 03:41:34 pm »
so.....i get the script but where would i add this to .
http://unitedalliedforces.webs.com/




}UaF{ Server 68.186.149.97 port 23073

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Noob to Scripting...
« Reply #5 on: September 16, 2009, 04:48:31 pm »

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Noob to Scripting...
« Reply #6 on: September 16, 2009, 05:00:20 pm »
Ah sorry, forgot the escape character.
Should work now.

Offline |_ancer

  • Soldier
  • **
  • Posts: 153
  • again and again.
Re: Noob to Scripting...
« Reply #7 on: September 17, 2009, 03:08:45 am »
Code: (pascal) [Select]
{
ClusterFk - made by Dualbreathe~
Email me at dualbreathe@gmail.com for and inquiries.
}

function OnCommand(ID: Byte; Text: string): boolean;
var
i, all, player: byte;
Temp1: Variant;
name: String;
begin
Name := GetPlayerStat(ID,'Name');
Result := False
if GetPiece(Text,' ',0) = '/clu' then
 i := StrToInt(GetPiece(Text,' ',1));
  if (GetPlayerStat(I, 'active') = true) then begin
     CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0, 0, 1000, 10, ID);
     
      end;
     begin
     if Text = '/cluall'
        then for all := 1 to NumPlayers do
         if all <> ID then
            CreateBullet(GetPlayerStat(all,'x'), GetPlayerStat(all,'y') - 0, 0, 0, 1000, 10, ID);
              end;

         
     if GetPiece(text,' ',0) = '/die' then
     begin
       player := StrToInt(GetPiece(Text,' ',1));
       Temp1 := StrToInt(GetPiece(Text,' ',2));
       if (GetPlayerStat(player, 'Active') = True) then begin
         CreateBullet(GetPlayerStat(player,'x'), GetPlayerStat(player,'y') - 0, 0, 0, 1000, Temp1, ID);
          end;
          end;
       
         
 if Text = '/clusterhelp' then begin
    WriteConsole(ID,'---------', RGB(255, 0, 0));
    WriteConsole(ID,'Welcome, '+Name+', who is admin of this sever', RGB(0, 255, 0));
    WriteConsole(ID,'/clu ID - shoots a cluster at that id', RGB(255, 0, 0));
    WriteConsole(ID,'/cluall - shoots clusters at everyone except you', RGB(255, 0, 0));
    WriteConsole(ID,'/die ID BulletType - self explainable', RGB(255, 0, 0));
    WriteConsole(ID,'---------', RGB(255, 0, 0));
    end;
end;
Admin commands to abuse.