0 Members and 1 Guest are viewing this topic.
function OnPlayerCommand(ID: Byte; Text: string): boolean;var inputNick, tempNick, InputPassword, InputPasswordLogin, nick: string; currentDate: string;begin //displays player stats if (Copy(Text,1,6) = '!stats') then begin if GetPlayerStat(ID, 'Active') = true then begin nick := GetPlayerStat(ID,'name'); //check if player already got profile or not if FileExists('stats/nickreg/'+filterFileName(nick)+'.txt') = true then begin //load player profile LoadNickname(FilterFilename(GetPlayerStat(ID,'name')),ID); //display stats DrawText(ID,'Kills: ' +nickName_Kills[ID],GOOD);(255,0,0),0.5,48,260); DrawText(ID,'Deaths: ' +nickName_Deaths[ID],GOOD);(255,0,0),0.5,48,260); DrawText(ID,'SelfKills: '+nickName_SelfKills[ID],GOOD);(255,0,0),0.5,48,260); //check if player has more then 0 deaths otherwise its divide by zero if strtoint(nickName_Deaths[ID]) > 0 then begin kdKills[ID] := strtoint(nickName_Kills[ID]); kdDeaths[ID] := strtoint(nickName_Deaths[ID]); kdRatio[ID] := kdKills[ID] / kdDeaths[ID]; WriteConsole(ID,'K/D Ratio: '+floattostr(roundto(kdRatio[ID],2)),GOOD); end end else begin WriteConsole(ID,'You do not have a profile!',BAD); end end end
if (Copy(Text,1,6) = '/stats') then
if (Copy(Text,2,5) = 'stats')
DrawText(ID,'Kills: ' +nickName_Kills[ID],GOOD);(255,0,0),0.5,48,260);
DrawText(ID,'Kills: ' +nickName_Kills[ID],GOOD,RGB(255,0,0),0.5,48,260);
DrawText(ID,'Kills: ' +nickName_Kills[ID] + #13#10 + Deaths: ' +nickName_Deaths[ID] + #13#10 + SelfKills: '+nickName_SelfKills[ID],GOOD,RGB(255,0,0),0.5,48,260);
I want to do something like this:
DrawText(ID,'Kills:' +inttostr(nickName_Kills[ID]) +' Deaths:' +inttostr(nickName_Deaths[ID]) +' SelfKills:'+inttostr(nickName_SelfKills[ID]),GOOD,RGB(255,0,0),0.5,48,260);
//ONPLAYERCOMMANDfunction OnPlayerCommand(ID: Byte; Text: string): boolean;var inputNick, tempNick, InputPassword, InputPasswordLogin, nick: string; currentDate: string;begin //displays player stats if (Copy(Text,1,6) = '/stats') then begin if GetPlayerStat(ID, 'Active') = true then begin nick := GetPlayerStat(ID,'name'); //check if player already got profile or not if FileExists('stats/nickreg/'+filterFileName(nick)+'.txt') = true then begin //load player profile LoadNickname(FilterFilename(GetPlayerStat(ID,'name')),ID); DrawText(ID,'Kills:' +inttostr(nickName_Kills[ID]) +' Deaths:' +inttostr(nickName_Deaths[ID]) +' SelfKills:'+inttostr(nickName_SelfKills[ID]),GOOD,RGB(255,0,0),0.5,48,260); //check if player has more then 0 deaths otherwise its divide by zero if strtoint(nickName_Deaths[ID]) > 0 then begin kdKills[ID] := strtoint(nickName_Kills[ID]); kdDeaths[ID] := strtoint(nickName_Deaths[ID]); kdRatio[ID] := kdKills[ID] / kdDeaths[ID]; WriteConsole(ID,'K/D Ratio: '+floattostr(roundto(kdRatio[ID],2)),GOOD); end end else begin WriteConsole(ID,'You do not have a profile!',BAD); end end end