Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: xmRipper on January 15, 2007, 02:53:07 pm

Title: i've got some questions
Post by: xmRipper on January 15, 2007, 02:53:07 pm
- if player name is major, how i kick him? (pascal script)

- How i get random pass. When i say !randompass ? (pascal script)

- in dedicated server 2.6.0 in deathmatch mode is there will be a command to DM team?

(sorry bad english)

Thanks.
Title: Re: i've got some questions
Post by: cooz on January 15, 2007, 03:23:10 pm
1.
Code: [Select]
procedure OnJoinGame(IP, Nickname: string;Team: byte)
begin
  if nickname = 'Major' then kickplayer(nametoid(Nickname));
end;

2.
you can't in current version, and i don't quite understand what you're asking for

3.
i wish it'll be there
Title: Re: i've got some questions
Post by: xmRipper on January 15, 2007, 03:42:38 pm
thanks.

i want to add a 4 digit random password when i type !randompass
Title: Re: i've got some questions
Post by: cooz on January 15, 2007, 04:01:24 pm
server pass, not admin pass, right?

yeah probably could be done in v2.6 ;)
Title: Re: i've got some questions
Post by: xmRipper on January 15, 2007, 04:21:03 pm
i've got one question more, if a player swear,like typing  "fu*k" word how can i make him banned automatickly

Code: [Select]
procedure OnPlayerSpeak(Name,Text: string);
begin
if (Text=*fu.k*) then
Command('/ban '+inttostr(NameToID(name)));
end;

it doesnt work.. :(
Title: Re: i've got some questions
Post by: cooz on January 15, 2007, 04:32:00 pm
try:
if(Text='fu.k') then

' instead of *
oh and you can always ask me on pm questions like that ;)
Title: Re: i've got some questions
Post by: xmRipper on January 15, 2007, 05:14:51 pm
if i use if(Text='fu.k') in sentence server doesn't understand it. nothing?
Title: Re: i've got some questions
Post by: CarlHamilton on January 16, 2007, 08:45:19 am
This' what you're trying to do?
Code: [Select]
procedure OnPlayerSpeak(Name,Text: string);
begin
    if (maskcheck(text, '*insert naughty word here*')) then
        command('/ban '+inttostr(nametoid(name)));
end;
Title: Re: i've got some questions
Post by: xmRipper on January 16, 2007, 11:29:00 am
yea! its works, thanks ;)

Date Posted: January 16, 2007, 10:54:29 AM
cooz,

Code: [Select]
procedure OnJoinGame(IP, Nickname: string;Team: byte)
begin
  if nickname = 'Major' then kickplayer(nametoid(Nickname));
end;

it doesnt work :S
Title: Re: i've got some questions
Post by: cooz on January 16, 2007, 12:09:12 pm
uhh, sorry

this should be good
Code: [Select]
procedure OnJoinTeam(IP, Nickname: string;Team: byte);
begin
if nickname = 'Major' then kickplayer(nametoid(Nickname));
end;
Title: Re: i've got some questions
Post by: xmRipper on January 16, 2007, 02:36:18 pm
ok. thanks cooz :)
Title: Re: i've got some questions
Post by: xmRipper on January 16, 2007, 02:53:51 pm
one question more ;D

Code: [Select]
procedure OnPlayerSpeak(Name,Text: string;ID: integer);
begin
  if (maskcheck(text, '*fu.k*')) then
  WriteLnFile('log.txt',IDToName(ID)+' = '+text);
end;

what is wrong ?  :-\
(http://img128.imageshack.us/img128/5167/errev4.png)
Title: Re: i've got some questions
Post by: CarlHamilton on January 16, 2007, 03:02:35 pm
Too many a ' might become a problem.
Maybe this'll work better?
Code: [Select]
procedure OnPlayerSpeak(Name,Text: string;ID: integer);
begin
    if (maskcheck(text, '*dumdumdum*')) then
        WriteLnFile('log.txt',IDToName(ID)+' = '+text);
end;
Title: Re: i've got some questions
Post by: xmRipper on January 16, 2007, 03:15:40 pm
Too many a ' might become a problem.
Maybe this'll work better?
Code: [Select]
procedure OnPlayerSpeak(Name,Text: string;ID: integer);
begin
    if (maskcheck(text, '*dumdumdum*')) then
        WriteLnFile('log.txt',IDToName(ID)+' = '+text);
end;

this didn't work also :(

(http://img128.imageshack.us/img128/5167/errev4.png)
Title: Re: i've got some questions
Post by: cooz on January 16, 2007, 03:19:57 pm
uhh, where did you boys find ID in onplayerspeak() arg? :)

hehe, now i understand what those stars mean at first place

Code: [Select]
procedure OnPlayerSpeak(Name,Text: string);
begin
  if(ContainsString(Text,'fu.k')=true) then
   WriteLnFile('log.txt',Name+' = '+text);
end;
Title: Re: i've got some questions
Post by: xmRipper on January 16, 2007, 04:04:21 pm
lol ;D ;D ;D ;D ;D

thanks again ;D

Date Posted: January 16, 2007, 03:36:49 PM
How can I active the new scprits when I do some changes in scripts without closing the servers?
Title: Re: i've got some questions
Post by: cooz on January 16, 2007, 05:18:29 pm
use /recompile commad, it'll restart server though

oh and maybe with next question about scripts
you could go: irc.quakenet.org,
you can find me there at eg. #soldat.devs channel
cause this topic looks more like chat than forum :-X