Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: Gnintendo on December 19, 2007, 07:18:17 pm
-
Script Name: Admin Invisibility 2.2 Final
Script Description: Admin command that gives yourself Invisibility by typing /invis and gets rid of it by typing /invis again. You can also give other people Invisibility with /invis <ID>, again just repeat that to take away somebody's Invisibility.
Original Author(s): Gnintendo, thanks to curt for helping me with 1.0. Special thanks to Kavukamari.
Core Version: 2.6.3
Code Snippet:
  If GetPlayerStat(Target,'Team') <> 5 Then Begin
  If GetPlayerStat(Target, 'Active') = True Then Begin
  If Players[Target].Invisible Then Begin
   Players[Target].Invisible := False
   WriteConsole(Target, GetPlayerStat(Target, 'Name') + '''s Invisibility has been disabled.', $FFFF0000);
   if (Target <> ID) then WriteConsole(ID, GetPlayerStat(Target, 'Name') + '''s Invisibility has been disabled.', $FFFF0000);
   Players[Target].InvisibleCounter := 0;
  End Else Begin
   Players[Target].Invisible := True
   WriteConsole(Target, GetPlayerStat(Target, 'Name') + ' has been given Invisibility.', $FF43DF02);
   if (Target <> ID) then WriteConsole(ID, GetPlayerStat(Target, 'Name') + ' has been given Invisibility.', $FF43DF02);
   GiveBonus(Target, 1);
   DrawText(Target, ' ', 1, $00000000, 1, 0, 0);
   Players[Target].InvisibleCounter := InitialInvisibleCounter;
  End; Â
 End;
End;
End;
End;
-
You should also have it give invisibility to the players with invis when they first respawn.
-
You should also have it give invisibility to the players with invis when they first respawn.
Good idea, I guess I'll add that later when I have some extra time. Maybe tomorrow afternoon I'll make a 1.1 version of the code including that.
-
add this in there, so the invisibility lasts
procedure AppOnIdle(Ticks: integer);
var
Time: array[1..32] of integer;
i: integer;
begin
for i:=1 to 32 do begin
if not Invisible[i] then continue else begin
if Time[i] = 0 then begin
GiveBonus(i,1);
Time[i]:=20;
end else if Time[i] > 0 then Time[i]:=Time[i]-1;
end;
end;
end;
I think the code is valid...
-
add this in there, so the invisibility lasts
procedure AppOnIdle(Ticks: integer);
var
Time: array[1..32] of integer;
i: integer;
begin
for i:=1 to 32 do begin
if not Invisible[i] then continue else begin
if Time[i] = 0 then begin
GiveBonus(i,1);
Time[i]:=20;
end else if Time[i] > 0 then Time[i]:=Time[i]-1;
end;
end;
end;
I think the code is valid...
Wow, I'm disapointed in you. You just assumed I'm too stupid to add that, it was already there. That proves you didn't even check to see if I had it, you just assumed I was too stupid.
Date Posted: December 19, 2007, 09:52:54 pm
Ok, the next version (1.1) is finished, I'm just doing some testing to make sure there aren't any bugs. I'll post it as soon as I'm SURE it's good.
-
how come when I try to use this on my server, it says something about "out of range"?
-
how come when I try to use this on my server, it says something about "out of range"?
Another code must be interfering, the text out of range isn't even in my code anywhere. Your server must have some other problem or you posted thinking you downloaded something you didn't.
Date Posted: December 24, 2007, 03:51:18 pm
I have released version 1.1 with a lot of changes all for the better. I hope you download it :D.
Please tell me what you think :D.
Date Posted: December 25, 2007, 07:38:29 am
Edited, I made a major modification that lets you give Invisibility to other players and take it from them if you want.
Date Posted: January 13, 2008, 09:32:16 am
2.1 Final released...have fun....
-
You should check if GetPlayerStat(Id, 'Active') = true having /invis <id> cmd's action done
Another small thing, when im in spec and i do "/invis 1", predator shading and stuff comes up, shouldn't have it give when spec
Other than that, gj
-
You should check if GetPlayerStat(Id, 'Active') = true having /invis <id> cmd's action done
Another small thing, when im in spec and i do "/invis 1", predator shading and stuff comes up, shouldn't have it give when spec
Other than that, gj
The getplayerstat line IS in there...because it says they aren't active...same thing pretty much...actualy more of an add on...I might have removed the line let me double check right now...
nope, it's there here's a quote straight from the script:
If GetPlayerStat(Target, 'Active') = False Then Begin
WriteConsole(ID, 'Can not find that player', $FFFF0000);
End;
Also, I forgot about the spectator thing...it's not big deal though really makes no difference, they can undo it and it goes away when they leave...I might add it later...a.k.a. it's on my do before I die list.
-
add this in there, so the invisibility lasts
procedure AppOnIdle(Ticks: integer);
var
Time: array[1..32] of integer;
i: integer;
begin
for i:=1 to 32 do begin
if not Invisible[i] then continue else begin
if Time[i] = 0 then begin
GiveBonus(i,1);
Time[i]:=20;
end else if Time[i] > 0 then Time[i]:=Time[i]-1;
end;
end;
end;
I think the code is valid...
Wow, I'm disapointed in you. You just assumed I'm too stupid to add that, it was already there. That proves you didn't even check to see if I had it, you just assumed I was too stupid.
Date Posted: December 19, 2007, 09:52:54 pm
Ok, the next version (1.1) is finished, I'm just doing some testing to make sure there aren't any bugs. I'll post it as soon as I'm SURE it's good.
I didnt assume you were stupid, I was just too lazy to check the script
-
You should check if GetPlayerStat(Id, 'Active') = true having /invis <id> cmd's action done
Another small thing, when im in spec and i do "/invis 1", predator shading and stuff comes up, shouldn't have it give when spec
Other than that, gj
The getplayerstat line IS in there...because it says they aren't active...same thing pretty much...actualy more of an add on...I might have removed the line let me double check right now...
Sry, missed the message saying that it could not find the player, but it still seems to say " has been given Invisibility." message, so i didn't see the message saying player wasn't found at first :)
If GetPlayerStat(Target, 'Active') = False Then Begin
WriteConsole(ID, 'Can not find that player', $FFFF0000);
End else Begin
//...
End;
instead of what it currently is, says the message b4 adding invis.
-
You should check if GetPlayerStat(Id, 'Active') = true having /invis <id> cmd's action done
Another small thing, when im in spec and i do "/invis 1", predator shading and stuff comes up, shouldn't have it give when spec
Other than that, gj
The getplayerstat line IS in there...because it says they aren't active...same thing pretty much...actualy more of an add on...I might have removed the line let me double check right now...
Sry, missed the message saying that it could not find the player, but it still seems to say " has been given Invisibility." message, so i didn't see the message saying player wasn't found at first :)
If GetPlayerStat(Target, 'Active') = False Then Begin
WriteConsole(ID, 'Can not find that player', $FFFF0000);
End else Begin
//...
End;
instead of what it currently is, says the message b4 adding invis.
I figured out what you meant before that, I was too lazy to edit my post. xD....I'll fix it later today.
Date Posted: January 14, 2008, 07:19:14 am
2.2 Final released, fixed all possible Spectator/non-existing player bugs. Enjoy.
Date Posted: January 14, 2008, 04:20:31 pm
I noticed some people on some servers like to use this code to give everybody invisibility and play that way, doing this is very inconvenient. I guess what I'm trying to say is I'll probably code a new version of this script that has two new commands /invisallon and /invisalloff.
/invisallon will give everybody invisibility even if people leave and even the people that join.
/invisalloff will turn off this mode where everybody has invisibility
there will also be an extra caution put in place where if the admin that turned the /invisallon mode on leaves the game, it automatically goes back to regular mode, that way you can't accidentally leave your server and everybody have invisibility.
Ok if you think it's a good idea say so...
-
i love it, its great, i love it, it may come in handy
-
its great but i think when i /invis 1 again, i must be uninvisible at this moment.
but i wait 15 sec. to be uninvisible.
sorry for my english:D [uninvisible, ...]
-
It's impossible to stop predator via script, but you can always kill yourself to become visible.
-
It's impossible to stop predator via script, but you can always kill yourself to become visible.
possibly may be a way to kill yourself, but respawn instantly? or if not, whatever.. moveplayer back to previous location when died. some sort of work-around but just thinking it through i don't think a very smooth one can be made.
-
you could save the player's coords, then move him out of the map so he'll respawn (and won't get a death), then move him back. takes about half a second.
-
/setteam will respawn you instantly, if needed twice. It can be smooth enough...
-
Interesting ideas...I'll have to try some of them when I have time later.
While you can teleport back to where you were, you lose all of your momentum and it still takes time...