0 Members and 1 Guest are viewing this topic.
PlayerInfo[ID].Wep1 := iif(Players[id].Primary.Wtype>16,17,Players[id].Primary.Wtype); WriteLn(inttostr(Players[id].Primary.Wtype)); //return 8 WriteLn(inttostr(PlayerInfo[ID].Wep1)); //return 56
type tPlayerInfo = record Wep1: byte;end;PlayerInfo: array[1..32] of tPlayerInfo;procedure WeaponAmmoChangeLimit(ID:byte);begin case (PlayerInfo[id].ClassID) of 3: begin if (PlayerInfo[ID].Resp=False) then begin PlayerInfo[ID].Wep1 := iif(Players[id].Primary.Wtype>16,17,Players[id].Primary.Wtype); WriteLn(inttostr(Players[id].Primary.Wtype)); //return 8 WriteLn(inttostr(PlayerInfo[ID].Wep1)); //return 56 end; end; end;end;procedure AppOnIdleSC3(Ticks: integer);var i,b: byte; ReloadWep: TNewWeapon; fastkd:single;beginfor i:= 1 to 32 do if (Players[i].Active) then begin if (Players[i].X > PlayerInfo[i].LastX+5) or (Players[i].X < PlayerInfo[i].LastX-5) then begin PlayerInfo[i].Resp:=false; WeaponAmmoChangeLimit(i); end;end;//lastx is singlle and change if player be respawn
PlayerInfo[ID].Wep1 := iif(Players[id].Primary.Wtype>16,17,Players[id].Primary.Wtype);
if (Players[id].Primary.Wtype>16) then PlayerInfo[ID].Wep1 := 17 else PlayerInfo[ID].Wep1 := Players[id].Primary.Wtype;
Code: [Select] PlayerInfo[ID].Wep1 := iif(Players[id].Primary.Wtype>16,17,Players[id].Primary.Wtype);if im change this : (this work bad) send 56 non 8Code: [Select]PlayerInfo[ID].Wep1 := iif(Players[id].Primary.Wtype>16,17,Players[id].Primary.Wtype);to this : (this work good)Code: [Select]if (Players[id].Primary.Wtype>16) then PlayerInfo[ID].Wep1 := 17 else PlayerInfo[ID].Wep1 := Players[id].Primary.Wtype;and im know im can use down metchod but im report bug for u last work good
There's an extra 'i' in "if" in the bad code (making it "iif"); maybe that's [part of] the problem
What's the problem? Where devs help?
function OnAdmCmd(p: TActivePlayer; Text: string): boolean;var w: TNewWeapon;begin if Text = '/test' then begin w := TNewWeapon.Create(); try w.WType := WTYPE_BARRETT; p.ForceWeapon(w, w); finally w.Free(); end; end; if Text = '/test2' then begin WriteLn('WType '+inttostr(iif(p.Primary.Wtype > 16, 17, p.Primary.Wtype))); end;end;
► / 21:39:46 /test(127.0.0.1[~ Mighty])► 21:39:49 [~ Mighty] got barret► 21:39:53 WType 8► / /test2(127.0.0.1[~ Mighty])
if Text = '/test2' then begin WriteLn('WType '+inttostr(iif(p.Primary.Wtype > 16, 17, p.Primary.Wtype))); if p.Primary.WType > 16 then WriteLn('WType 17') else WriteLn('WType '+inttostr(p.Primary.WType)); end;
► + ~ Mighty has joined alpha team.► 17:37:39 WType 8► WType 8► / /test2(127.0.0.1[~ Mighty])