Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: mich1103 on March 21, 2010, 03:30:03 pm
-
I've seen this topic : http://forums.soldat.pl/index.php?topic=32697.0
About looting ...
Can i do like :
procedure DropLoot(ID,Killer: byte);
var rand,drop: byte;
loot: string;
begin
//WriteConsole(Killer,'You've just looted a item.',$ff5555ff);
loot := '';
drop := 0;
rand := Random(0,100);
case IGB[ID].bname of
'Zombie': begin
if rand >= 75 then begin
if rand >= 85 then begin
if rand >= 90 then begin
drop := 16;
end else drop := 17;
end else drop := 18;
end else drop := 19;
end else drop := 20;
end else drop := 21;
end else drop := 22;
end else drop := 23;
end;
end;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if drop > 0 then begin
SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),drop);
WriteConsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
-
Say what changed because most of people won't even start to compare these scripts and it's you who should care about the answer.
-
The script i've put is not good i just want to make a script that when the bot named ''Zombie'' die there is 25% to drop one of this item :
'Medical Kit'
'Grenade Kit';
'Flamer Kit';
'Vest Kit';
'Predator Kit';
'Berserk Kit';
'Cluster Kit';
and i want thats say like :
You've just looted a''THE LOOT HERE''!
-
Heres what i use:
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;
procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([1,16,17]);
'Elite Zombie': drop := choose([18,19,22,5]);
// just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
-
i've used that and the script has passed but there is no drop !
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;
procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([22,21,20,19,18,16,17])
// just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
-
How are you using it? Like:
onplayerkill(killer,victim: byte);
begin
droploot(victim,killer);
end;
?
-
I don't use that !
-
/facepalm
It's a procedure dropping random item at player's location, you need to use it in a build-in event.
-
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?
-
(http://cdn2.knowyourmeme.com/i/15945/original/Double_Facepalm_by_ScotlandForLife.jpg)
-
OMG !
-
As you should notice the /facepalm is separated from the information below.
edit: /triplefacepalm btw
-
WTF !!!
i don't understand the facepalm !
-
Mich, what you've done in the script is only the procedure, but you need to call it somewhere. Just paste the code Hacktank wrote into your script.
-
i don't have script !
i want to make one !
but the HT script is what i need to use ?
-
Well just paste the code from your first post into a .pas file and add this:
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
begin
DropLoot(Victim, Killer);
end;
-
Like that ?
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
begin
DropLoot(Victim, Killer);
end;
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;
procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([22,21,20,19,18,16,17])
// just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
-
Close, OnPlayerKill() has to be under DropLoot()
-
The script has passed but after 2 min ive started teh server the server crash !!!
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;
procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([22,21,20,19,18,16,17])
// just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
begin
DropLoot(Victim, Killer);
end;
-
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?
OMFG i never have lolled so hard in my life before never!
-
Mich, post us the error the server outputs please.
-
The error message :
[*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:27:52 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:27:56 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:00 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:00 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:05 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:05 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:05 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:05 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:05 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] [Error] wa -> (OnPlayerKill): Invalid parameter
10-03-25 06:28:06 [*] Too many script errors! Shutting down server -> "wa"
10-03-25 06:28:06 Shutting down server...
10-03-25 06:28:06 Shutting down FileServer...
10-03-25 06:28:06 Shutting down admin server...
10-03-25 06:28:06 Shutting down ScriptCore...
From: March 25, 2010, 07:04:27 pm
And Stuffy how you've know my name ?
-
Even though the enesce.com/help clearly says
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
It MUST be (on my test server anyway, it was causing the exact errors mich just mentioned):
procedure OnPlayerKill(Killer, Victim: byte; Weapon: String);
Also, this should work for doing a chance to do something, as it says you need in your sig:
procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then case getplayerstat(ID,'name') of
'Zombie': drop := choose([1,16,17]);
'Elite Zombie': drop := choose([18,19,22,5]);
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
function Chance(Perc: single): boolean;
begin
result := (strtofloat(inttostr(random(0,101)))/100.0 < perc);
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if chance(0.5) then droploot(victim,killer); // 50% chance of dropping loot, 0.2 would be a 20% chance, ect
end;
-
Hmmm ... :'(
Error :
10-03-25 20:05:48 [*] Compiling wa -> wa.pas...
10-03-25 20:05:48 [*] wa -> [Error] (7:20): Unknown identifier 'choose'
10-03-25 20:05:48 [*] Compilation Failed.
10-03-25 20:05:48 Shutting down server...
10-03-25 20:05:48 Shutting down admin server...
10-03-25 20:05:49 Shutting down ScriptCore...
-
You need the choose from my previous post.
( with choose() )
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;
procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then case getplayerstat(ID,'name') of
'Zombie': drop := choose([1,16,17]);
'Elite Zombie': drop := choose([18,19,22,5]);
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;
function Chance(Perc: single): boolean;
begin
result := (strtofloat(inttostr(random(0,101)))/100.0 < perc);
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if chance(0.5) then droploot(victim,killer); // 50% chance of dropping loot, 0.2 would be a 20% chance, ect
end;
-
Thanks man that's work !!! ;D
But i have another problem ... :-\
i have a simple script that when a player want to join bravo team that put it on the alpha team
const
ZombieTeam = 2; // Team of zombies
procedure OnJoinTeam(ID, Team: byte);
begin
if Team = ZombieTeam then
Command('/setteam' + iif(ZombieTeam = 2, '1', '2') + ' ' + inttostr(ID));
end;
But i want when a alpha player die that put it into bravo team!
i can ???
-
Untested but it should work:
type plr = record
targetteam: byte;
end;
var
players: array[1..32] of plr;
procedure ConstrainTeam(ID, CurTeam: Byte);
begin
if curteam <> players[ID].targetteam then command('/setteam'+inttostr(players[ID].targetteam)+' '+inttostr(id));
end;
procedure OnJoinGame(ID, Team: Byte);
begin
players[ID].targetteam := iif(getplayerstat(ID,'human'),1,2);
end;
procedure OnJoinTeam(ID, Team: Byte);
begin
constrainteam(ID,team);
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if players[victim].targetteam = 1 then players[victim].targetteam := 2 else players[victim].targetteam := 1;
constrainteam(victim,getplayerstat(victim,'team'));
end;
-
The script lagg too much XD
-
I am at a total loss to what could be causing that...
With this trimmed code below i confirm that targteam and team are the same yet it finds them to be different and runs command(setteam) again causing an infinite loop... Someone else here, please tell me what in gods name is wrong.
type plr = record
targetteam: byte;
end;
var
players: array[1..32] of plr;
procedure OnJoinGame(ID, Team: Byte);
begin
players[ID].targetteam := iif(getplayerstat(ID,'human'),1,2);
end;
procedure OnJoinTeam(ID, Team: Byte);
begin
if team <> 5 then if team <> players[ID].targetteam then command('/setteam'+inttostr(players[ID].targetteam)+' '+inttostr(id));
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if killer <> victim then begin
if players[victim].targetteam = 1 then players[victim].targetteam := 2 else players[victim].targetteam := 1;
command('/setteam'+inttostr(players[victim].targetteam)+' '+inttostr(victim));
end;
end;
-
thats dont work because when i kill a zombie the zombie join alpha XD
i just want when a bravo player kill a alpha player that put the alpha player who got killed in the bravo team !!!
From: March 25, 2010, 09:04:55 pm
And can you put that all player and bot cant go on charlie and delta team ???
-
And Stuffy how you've know my name ?
Because it's your nick and nick is something we can see?
var
Died: array[1..32] of boolean;
procedure OnJoinGame(ID, Team: byte);
begin
Dead[ID]:= false;
end;
procedure OnJoinTeam(ID, Team: byte);
begin
if Dead[ID] and (Team <> 2) and (Team <> 5) then Command('/setteam2 ' + IntToStr(ID));
end;
procedure OnPlayerRespawn(ID: byte);
begin
if Dead[ID] then Command('/setteam2 ' + IntToStr(ID));
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
Dead[Victim]:= true;
end;
Simple and sexy.
-
Error ... 10-03-26 06:03:39
[*] Zombie infections -> [Error] (7:3): Unknown identifier 'Dead'
10-03-26 06:03:39 [*] Compilation Failed.
10-03-26 06:03:39 Shutting down server...
10-03-26 06:03:39 Shutting down admin server...
10-03-26 06:03:39 Shutting down ScriptCore...
-
Gizd, I lol'd when I've read the error mich posted, epicfail :D
mich, try to look at the code and learn the error messages.
In this case it's missing the variable "Dead".
Search for var in the code, and look if it is declared, if not create it.
In this case Gizd named it "Died" instead of "Dead", that's why it's not working.
Replace "Died" with "Dead" and it works.
-
hmmmm very strange error...
ive change dead to died and when i got killed by a zombie or a kill myself that say soldatserver.exe has stop to work and no error is say on the log...
From: March 26, 2010, 08:19:18 am
Swompie i just want a script that you have in your server
when a alpha player get killed by a zombie(bravo team)that put the alpha player who got killed in the bravo team and he will not be able to go on alpha before the next game. I will do the other part of the script like when is no more player on alpha team then nextmap...
-
hmm try this:
var
Killed : array[1..32] of boolean;
Total, TotalB : integer;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: String);
begin
if GetPlayerStat(Victim,'Team') = 1 and GetPlayerStat(Victim,'Human') then begin
Killed[Victim] := true;
WriteConsole(0, 'Player ' + IdToName(Victim) + 'has been killed by an zombie and is now infected.', $123456);
Command('/setteam2' + IntToStr(Victim));
TotalB := TotalB +1;
end;
end;
procedure OnJoinTeam(ID, Team: byte);
var
i : integer;
begin
if (Killed[ID]) and (Team <> 5) then begin
Command('/setteam2' + IntToStr(ID));
WriteConsole(ID, 'You are infected!', $123456);
end;
if Total = TotalB then begin
WriteConsole(0, 'Everyone has been infected!!!', $123456);
for i := 1 to 32 do
Killed[i] := false;
for i := 1 to 32 do
Command('/setteam1' + IntToStr(i))
Command('/nextmap');
end;
end;
procedure OnJoinGame(ID, Team: byte);
begin
if GetPlayerStat(ID,'Human') then
Total := Total +1;
end;
Not tested!
-
Ok i found 2 bug
1-when i go on charlie that put me on alpha and that say soldatserver.exe has stop to work...
2-when i got killed by a zombie that dont put me on the bravo team !!!
-
Modified, try this:
var
Killed : array[1..32] of boolean;
Total, TotalB : integer;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: String);
begin
if GetPlayerStat(Victim,'Team') = 1 and GetPlayerStat(Victim,'Human') then begin
Killed[Victim] := true;
WriteConsole(0, 'Player ' + IdToName(Victim) + 'has been killed by an zombie and is now infected.', $123456);
Command('/setteam2 ' + IntToStr(Victim));
TotalB := TotalB +1;
end;
end;
procedure OnMapChange(NewMap: String);
var
i : integer;
begin
TotalB := 0;
if GetPlayerStat(i,'Human') then
Command('/setteam1 ' + IntToStr(i))
end;
procedure OnJoinTeam(ID, Team: byte);
var
i : integer;
begin
if (Killed[ID]) and (Team <> 5) and (Team <> 2) then begin
Command('/setteam2 ' + IntToStr(ID));
WriteConsole(ID, 'You are infected!', $123456);
end;
if Total = TotalB then begin
WriteConsole(0, 'Everyone has been infected!!!', $123456);
for i := 1 to 32 do
Killed[i] := false;
Command('/nextmap');
end;
end;
procedure OnJoinGame(ID, Team: byte);
begin
if GetPlayerStat(ID,'Human') then
Total := Total +1;
end;
-
when i join the game i can go on all team
when i got infected i can go on all team and when i join another team that say
All player are infected ...
and the game end(/nextmap)
-
try my code again, modified it.
-
The script dont work more ...
same error
-
Hmm this works fine for me.
var
Killed : array[1..32] of boolean;
Total, TotalB : integer;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: String);
begin
if GetPlayerStat(Victim,'Team') = 1 and GetPlayerStat(Victim,'Human') then begin
Killed[Victim] := true;
WriteConsole(0, 'Player ' + IdToName(Victim) + ' has been killed by an zombie and is now infected.', $123456);
Command('/setteam2 ' + IntToStr(Victim));
TotalB := TotalB +1;
end;
end;
procedure OnMapChange(NewMap: String);
var
i : integer;
begin
TotalB := 0;
if GetPlayerStat(i,'Human') then
Command('/setteam1 ' + IntToStr(i))
for i := 1 to 32 do if GetPlayerStat(i,'Human') then Command('/setteam1 ' + IntToStr(i));
end;
procedure OnJoinTeam(ID, Team: byte);
var
i : integer;
begin
if (Killed[ID]) and (Team <> 5) and (Team <> 2) then begin
Command('/setteam2 ' + IntToStr(ID));
WriteConsole(ID, 'You are infected!', $123456);
end else if not (Killed[ID]) and (Team <> 1) and (Team <> 5) then Command('/setteam1 ' + IntToStr(ID));
if Total = TotalB then begin
WriteConsole(0, 'Everyone has been infected!!!', $123456);
for i := 1 to 32 do
Killed[i] := false;
Command('/nextmap');
end;
end;
procedure OnJoinGame(ID, Team: byte);
begin
if GetPlayerStat(ID,'Human') then
Total := Total +1;
end;
-
that work but i got another problem
when all player are on bravo team that dont do /nextmap
if i try to go on another team that do /nextmap
-
PM me, i will answer your questions. If you can, send me full script file.
-
i have like 10 script i dont make one with all ^^
-
(http://cdn2.knowyourmeme.com/i/15945/original/Double_Facepalm_by_ScotlandForLife.jpg)
LMFAO!!!!!
-
(http://cdn2.knowyourmeme.com/i/15945/original/Double_Facepalm_by_ScotlandForLife.jpg)
LMFAO!!!!!
LOL. SPAM?