0 Members and 1 Guest are viewing this topic.
Like this! Oh, the joys of readable code. *sniff* Makes a grown man cry. (if you ask then yes. if you ask the other one, then no. stupid.)
procedure ListThemLittlePlayerThingys(ID: Byte);var i: Integer;begin // alpha if AlphaPlayers > 0 then WriteConsole(ID, 'Alpha Players...', $FFFF0000); for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Team') = 1 then WriteConsole(ID, GetPlayerStat(i, 'Name') + ': ' + inttostr(Player[i].Level), $FFFF0000); // bravo if BravoPlayers > 0 then WriteConsole(ID, 'Bravo Players...', $FF0000FF); for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Team') = 2 then WriteConsole(ID, GetPlayerStat(i, 'Name') + ': ' + inttostr(Player[i].Level), $FF0000FF);end;function OnCommand(ID: Byte; Text: String): Boolean;begin if Text = '/players' then ListThemLittlePlayerThingys(ID);end;
You should put the thingy in code tags Code: [Select]Like this! Oh, the joys of readable code. *sniff* Makes a grown man cry. (if you ask then yes. if you ask the other one, then no. stupid.)Oh yeah, not for you - since you figured it out - but to show others (if they wonder). Err, maybe I'm just doing it to promote the use of procedures and functions... Keep OnCommand clean, or be damned! Mwahahaha! *bangs head into desk* HEAVY METAL BABY (*listens to Kelly Clarkson*) ZOMG IM SO ALTERNATIVE, YOU ALL ARE MAINSTREAM MTV ZOMBIES (*votes for the underdog in Idol*). Damnit, I'd better stop this now or no amount of code in the world could stop this from being a spam post! Code: [Select]procedure ListThemLittlePlayerThingys(ID: Byte);var i: Integer;begin // alpha if AlphaPlayers > 0 then WriteConsole(ID, 'Alpha Players...', $FFFF0000); for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Team') = 1 then WriteConsole(ID, GetPlayerStat(i, 'Name') + ': ' + inttostr(Player[i].Level), $FFFF0000); // bravo if BravoPlayers > 0 then WriteConsole(ID, 'Bravo Players...', $FF0000FF); for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Team') = 2 then WriteConsole(ID, GetPlayerStat(i, 'Name') + ': ' + inttostr(Player[i].Level), $FF0000FF);end;function OnCommand(ID: Byte; Text: String): Boolean;begin if Text = '/players' then ListThemLittlePlayerThingys(ID);end;I didn't try it, so there might be some errors (if you run just this code, there will be for sure, since I didnt define Player) but it's pretty much how you'd do it. Unless there's a better way (then you should post that and let the rest of us bask in the everlasting glory of your soldat scripting skills).
Quote from: Boblekonvolutt on February 09, 2008, 11:54:51 pmYou should put the thingy in code tags Code: [Select]Like this! Oh, the joys of readable code. *sniff* Makes a grown man cry. (if you ask then yes. if you ask the other one, then no. stupid.)Oh yeah, not for you - since you figured it out - but to show others (if they wonder). Err, maybe I'm just doing it to promote the use of procedures and functions... Keep OnCommand clean, or be damned! Mwahahaha! *bangs head into desk* HEAVY METAL BABY (*listens to Kelly Clarkson*) ZOMG IM SO ALTERNATIVE, YOU ALL ARE MAINSTREAM MTV ZOMBIES (*votes for the underdog in Idol*). Damnit, I'd better stop this now or no amount of code in the world could stop this from being a spam post! Code: [Select]procedure ListThemLittlePlayerThingys(ID: Byte);var i: Integer;begin // alpha if AlphaPlayers > 0 then WriteConsole(ID, 'Alpha Players...', $FFFF0000); for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Team') = 1 then WriteConsole(ID, GetPlayerStat(i, 'Name') + ': ' + inttostr(Player[i].Level), $FFFF0000); // bravo if BravoPlayers > 0 then WriteConsole(ID, 'Bravo Players...', $FF0000FF); for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Team') = 2 then WriteConsole(ID, GetPlayerStat(i, 'Name') + ': ' + inttostr(Player[i].Level), $FF0000FF);end;function OnCommand(ID: Byte; Text: String): Boolean;begin if Text = '/players' then ListThemLittlePlayerThingys(ID);end;I didn't try it, so there might be some errors (if you run just this code, there will be for sure, since I didnt define Player) but it's pretty much how you'd do it. Unless there's a better way (then you should post that and let the rest of us bask in the everlasting glory of your soldat scripting skills).Read my post next time...here let me quote it for you."NVM figured it out"Also, that is a ton more work than you need to do, why the hell wouldn't you just do if getplayerstat thing team = 1 or 2 and then do the rest with an i instead of alpha players and bravo players.yeah...