Author Topic: Calculate player names  (Read 742 times)

0 Members and 1 Guest are viewing this topic.

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Calculate player names
« on: June 04, 2010, 10:25:53 am »
Hi there.

I want to know how i can write script thats calculating players with same name on mapchange... i have a boss on my server and i want to make autokick when there is more than 1 boss active but i dont know how to write it... can any1 help? :)
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Calculate player names
« Reply #1 on: June 04, 2010, 10:35:17 am »
Code: (pascal) [Select]
Procedure OnMapChange();
 Var B: Byte;
  Begin
   For B := 1 To 32 Do if GetPlayerStat(B,'Active') = True Then Begin
   if GetPlayerStat(B,'Name') = TheNameYouWantHere Then KickPlayer(B);
  end;
end;
« Last Edit: June 04, 2010, 10:45:45 am by squiddy »
www.soldatx.com.br - The brazilian Soldat community.

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Calculate player names
« Reply #2 on: June 04, 2010, 11:04:12 am »
ive made something like that:
Code: [Select]
if (getplayerstat(j,'name')='IllusionLord: Armageddon') then
begin
if (getplayerstat(j,'active')=true) then
begin
WriteConsole(0, 'Lord Armageddon is there! Kill him for rewards!!!' , RGB(0,255,255));
end else
begin
command('/addbot2 Illusion Lord Armageddon');
WriteConsole(0, 'Lord Armageddon is there! Kill him for rewards!!!' , RGB(0,255,255));
end;
end;
but it works only when boss is active, but when boss is kicked this code is not adding another one... why?
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Calculate player names
« Reply #3 on: June 04, 2010, 12:15:09 pm »
'Coz you added "else".

Code: (pascal) [Select]
if GetPlayerStat(J,'Name') = 'IllusionLord: Armageddon' Then Begin
 if GetPlayerStat(J,'Active') Then Begin
  WriteConsole(0,'Blablablabal..',$FFFFFF);
   Command('/addbot2 IllusionLord: Armageddon');
 end;
end;

//Else is used for when a certain condition is not followed.

//For exemple:

if GetPlayerStat(J,'Active') Then
 WriteLn('Hey, Armageddon is active at the moment')
  else
 WriteLn('Ohh, Armageddon is so NOT active right now');

//See?
www.soldatx.com.br - The brazilian Soldat community.