0 Members and 2 Guests are viewing this topic.
i will fix up the code when this bug is fixed
READ BEFORE YOU POST FFS!!!!! YOU PEOPLE DONT f**kING READ THEN WONDER WHY WHY PEOPLE GET f**kING UPSET!!!
do it or gtfo
Btw, why is the 'active' check needed since we check 'alive' too? 'Alive' will not return true if 'active' is false anyway.
i have come accross a wierd bug, i made this script: (attached) which logs everything to a single log file, (Text, Commands, Team Joins and Exceptions)only problem is, with the OnCommand Section there, instead of the command going through, it just logs the command and then does nothing, how do i get around this? (not released yet due to this bug so dont go searching)
Quote from: tk on July 22, 2010, 01:17:39 pmBtw, why is the 'active' check needed since we check 'alive' too? 'Alive' will not return true if 'active' is false anyway.i think that "Active" checks that player is IN GAME, but "Alive"... i think you understand it, checks that you are dead or not... so what is different? ask yourselfbtw, this topic is funny... ^^
procedure OnPlayerCommand(ID: Byte; Text: string);beginWriteLnFile('PlayerSpeech/PlayerSpeechLog-'+FormatDate('dd')+'-'+FormatDate('mm')+'-'+FormatDate('yyyy')+'.txt',FormatDate('hh:mm am/pm')+'::'+IDtoname(ID)+'::'+Text);Result:=False;end;
procedure RangeKill(Owner, Victim, Range, VelX ,VelY, HitMult, BulletType:Integer);var i:Byte;begin x := GetPlayerStat(Victim,'x'); y := GetPlayerStat(Victim,'y'); for i := 1 to 32 do begin x2 := GetPlayerStat(i,'x'); y2 := GetPlayerStat(i,'y'); if (RayCast(x,y,x2,y2,Dist,Range)) AND (i <> Owner) AND (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Team') <> GetPlayerStat(Owner,'Team')) then begin CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, VelX,VelY,HitMult, BulletType, Owner); BioKills[Owner]:=BioKills[Owner]+1; end; end; WriteConsole(Owner,'Bio-Kills: '+Inttostr(BioKills[Owner]),$EE81FAA1); BioKills[Owner] := 0;end;
(GetPlayerStat(i,'Team') <> GetPlayerStat(Owner,'Team'))
Team := GetPlayerStat(Owner, 'Team');for i := 1 to 32 doif (..) and (Team <> GetPlayerStat(i, 'Team') then
GetPlayerStat(i,'y') - 0
other scripts
(12:30:34) [*] [Error] Achievement -> OnPlayerKill: Access violation at address 0808AD0E, accessing address 0160000C
procedure ForceAchUpdate(ID:Byte; Ach:String); //will update current accounts with new achievements to get as the players join (going to use in OnJoinTeam)beginif ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'0'); if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Ach:=True; //Replaces Ach with the string in the sytax so say if i use ForceAchUpdate(ID, 'yeahyeah')'; it should make Ach[ID] into yeahyeah[ID] where i want to use the code, but i get a type mismatch error here as Ach isnt an array if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Ach[ID]:=False;end;
procedure ForceAchUpdate(ID:Byte; Ach:String; Boolvar:array [1..32] of Boolean);beginif ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements',Ach[ID],'0'); if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Boolvar[ID]:=True; if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Boolvar[ID]:=False;end;