0 Members and 1 Guest are viewing this topic.
typewep=recordPrimary,Secondary:byte;end;varweps: array [1..12] of Wep;Function AlphaAPlayers:Byte;vari:byte;beginResult:=0;For i:=1 to 12 dobeginif GetPlayerStat(i, 'Active') then if GetPlayerStat(i, 'Alive') then if GetPlayerStat(i, 'Team') = 1 then Result:=Result+1;end;end;Function BravoAPlayers:byte;vari:byte;beginResult:=0;For i:=1 to 12 dobeginif GetPlayerStat(i, 'Active') then if GetPlayerStat(i, 'Alive') then if GetPlayerStat(i, 'Team') = 2 then Result:=Result+1;end;end;Function OneTeamAlive:Boolean;beginIf (BravoAPlayers>0) and (AlphaAPlayers=0) or (BravoAPlayers=0) and (AlphaAPlayers>0) then result:=TrueelseResult:=False;end;function players:boolean;vari,p:byte;beginP:=0;for i:=1 to 12 dobeginif (GetPlayerStat(i,'Active')= True) and (GetPlayerStat(i,'Team')<>5) then beginif Not GetPlayerStat(i,'Alive') then p:=p+1;end;end;if AlphaPlayers+BravoPlayers=P then Result:=True else Result:=False;end;procedure OnJoinGame(Id:Byte;Team:Byte);beginWeps[id].Primary:=66;Weps[id].Secondary:=66;end;procedure OnPlayerRespawn(ID: Byte);beginIf not Weps[ID].Primary=66 then ForceWeapon(ID, Weps[ID].Primary, Weps[Id].Secondary, 0);end;Procedure Destroyall;vari:byte;beginfor i:=1 to 128 doIf GetObjectStat(i, 'Active') then if GetObjectStat(i,'Style')<>27 then KillObject(i);end;Procedure SaveWeps;vari:byte;beginfor i:=1 to 12 doIf GetplayerStat(i, 'Active') then If GetPlayerStat(i,'Alive') then beginWeps[i].Primary:=GetPlayerStat(i,'Primary');Weps[i].Secondary:=GetPlayerStat(i,'Secondary');end else beginWeps[i].Primary:=66;Weps[i].Secondary:=66;end;end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);beginIf OneTeamAlive then SaveWeps;end;procedure AppOnIdle(Ticks: integer); beginIf Players then Destroyall;end;
Quote from: miketh2005 on July 10, 2009, 07:31:20 pmDonate to enesceHAHAHAHAHAHAHA
Donate to enesce
I post script here and maybe here somebody help me?
Quote from: Zabijaka on August 14, 2009, 01:16:48 amI post script here and maybe here somebody help me?Niko is offering to rewrite the script for you.
typewep = RecordPrimary, Secondary: Byte;end;varweps: array [1..16] of Wep;function AlphaAPlayers: Byte;var i: Byte;beginResult := 0;For i := 1 to 16 do begin if GetPlayerStat(i, 'Active') then if GetPlayerStat(i, 'Alive') then if GetPlayerStat(i, 'Team') = 1 then Result := Result + 1; end;end;function BravoAPlayers:Byte;vari:Byte;beginResult := 0;For i := 1 to 12 dobeginif GetPlayerStat(i, 'Active') then if GetPlayerStat(i, 'Alive') then if GetPlayerStat(i, 'Team') = 2 then Result := Result+1;end;end;Function OneTeamAlive:Boolean;beginif (BravoAPlayers>0) and (AlphaAPlayers = 0) or (BravoAPlayers = 0) and (AlphaAPlayers>0) then result := TrueelseResult := False;end;function players: Boolean;var i, p: Byte;beginp := 0;for i := 1 to 12 do begin if (GetPlayerStat(i, 'Active') = True) and (GetPlayerStat(i, 'Team') <> 5) then begin if not GetPlayerStat(i, 'Alive') then p := p + 1; end; end;if AlphaPlayers + BravoPlayers = p then Result := True else Result := False;end;procedure OnJoinTeam(ID, Team: Byte);beginWeps[id].Primary := 66;Weps[id].Secondary := 66;end;procedure OnPlayerRespawn(ID: Byte);beginif Weps[ID].Primary <> 66 then begin ForceWeapon(ID, Weps[ID].Primary, Weps[ID].Secondary, 0); end;end;procedure Destroyall;var i: Byte;beginfor i := 1 to 128 doif GetObjectStat(i, 'Active') then if GetObjectStat(i, 'Style') <> 27 then KillObject(i);end;procedure SaveWeps;var i: Byte;beginfor i := 1 to 12 do if GetplayerStat(i, 'Active') then if GetPlayerStat(i, 'Alive') then begin Weps[i].Primary := GetPlayerStat(i, 'Primary'); Weps[i].Secondary := GetPlayerStat(i, 'Secondary'); end else begin Weps[i].Primary := 66; Weps[i].Secondary := 66; end;end;procedure OnPlayerKill(Killer, Victim: Byte; Weapon: string);beginif OneTeamAlive then SaveWeps;end;procedure AppOnIdle(Ticks: integer);beginif Players then Destroyall;end;
I think using ForceWeapon() in OnPlayerRespawn() is a no go
nah, just give back the cost of the gun to the guy who had the gun at the end of the round.