0 Members and 1 Guest are viewing this topic.
if Player[Killer] = Player[Victim] then writeconsole(Victim,'your kill streak: '+inttostr(Kills[Victim]),$FFEO2OFE)
also, kills would be alot more than 32, or is that just storing the values for all 32 ppl? i am still a tiny bit confused about the arrays
Var Kills: Array[1..32] of Integer;Procedure OnPlayerKill(); Begin if Killer <> Victim Then Begin //Checks if killer is different from victim Kills[Killer] := Kills[Killer] + 1; //Increasing by one Killer's Kills. WriteConsole(Killer,'Your Kill Streak: '+IntToStr(Kills[Killer]),$FFFFFF); end else WriteConsole(ID,'You cant get kills by killing yourself!',$FFFFFF);end;//That should do it.//Arrays store data for [Min..Max] values you put in.//Like, go:Procedure OnPlayerSpeak(); Begin if Text = '!mykills' Then WriteConsole(ID,'Your kills: '+IntToStr(Kills[ID]),$FFFFFF);end;//See?//This \/{Var Kills: Integer;}//That /\ is a global var. It's unique for every player in the server.//If, for instance, you go "Kills := 0;", then every player's kills streak will be reseted.//Doing "Kills[ID] := 0;" would only reset one player's kills streak//Hope you've learned :)//Any more questions, feel free to ask :D
type // start type TPlayer = Record // name of the type Kills: integer; Anoter_Variable: byte; end; // declares the end of the TPlayer type.var Player: Array [1..32] of TPlayer; // next you need to declare it as an variable.//Looks like that when you use it: Player[ID].Variableprocedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin if Killer <> Victim then begin Player[Killer].Kills := Player[Killer] + 1; WriteConsole(ID, 'Kill streak: ' + inttostr(Player[Killer].Kills), $FFFFFF); end; Player[Victim].Kills := 0;end;
thanks swompie, see dnmr? no one else has any problem, if you post anything like that again ima just ignore it
so using a single tab for each indent is bad? if i use spaces then notepad++ doesnt show me the indent guide(the lines going from the begins to the ends) and using spaces somehow corrupts the script i had to use tabs as indent just to fix up one of my scripts so idk what to do
If you want Notepad++ to use two spaces instead of a real tab whenever you press the tab button, do the following:[...]
procedure OnMapChange(NewMap: string);begin For i := 1 to 32 do begin GiveBonus(i, BonusID); if GetPlayerStat(i,'Team') = 1 then begin Cash:=Cash+GetPlayerStat(i,'Kills'); WriteConsole(i,'Match Bonus, congrats you have earned your team: '+GetPlayerStat(i,'Kills')+' bonus cash for kills this match',$EE81FAA1); end; end;end;