ItsMods

Full Version: Getting list of player id's
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello ive tried to make so if i do !list i get a list appear of everyname and their id so i can do !kickc ID now this list should show everyperson 2 secounds inbetween.
Ive tried but failed this is what i have
OnAddonFrame
CSHARP Code
  1. int counterX = 0;
  2. public void OnAddonFrame(ServerClient Client)
  3. {
  4. if (counterX == 2*1000 / AddonFrameInterval)
  5. {
  6. counterX = 0;
  7. foreach (ServerClient client in GetClients())
  8. {
  9. TellClient(Client.ClientNum, client.ClientNum.ToString() + " - " + client.Name, true);
  10. }
  11. }
  12.  
  13. }

OnChatSay
CSHARP Code
  1. if (Message == "!list")
  2. {
  3. counterX = 2 * 1000 / AddonFrameInterval;
  4. }
You forgot the counterX++;
Where do i add that?

This is what i have now
OnAddonFrame
CSHARP Code
  1. int counterX = 0; // Red please move this i cant because its laggy teamviewer D;
  2. public void OnAddonFrame(ServerClient Client) // And this
  3. {
  4. if (counterX == 2*1000 / AddonFrameInterval)
  5. {
  6. counterX++;
  7. foreach (ServerClient client in GetClients())
  8. {
  9. TellClient(Client.ClientNum, client.ClientNum.ToString() + " - " + client.Name, true);
  10. counterX = 0;
  11. }
  12. }
  13.  
  14. }

OnChatSay
CSHARP Code
  1. if (Message == "!list")
  2. {
  3. counterX = 2 * 1000 / AddonFrameInterval;
  4. }
Please help
You put the ++ after whatever you're trying to increase it.
I know but read the post i made This is what i have now
OnAddonFrame
CSHARP Code
  1. int counterX = 0; // Red please move this i cant because its laggy teamviewer D;
  2. public void OnAddonFrame(ServerClient Client) // And this
  3. {
  4. if (counterX == 2*1000 / AddonFrameInterval)
  5. {
  6. counterX++;
  7. foreach (ServerClient client in GetClients())
  8. {
  9. TellClient(Client.ClientNum, client.ClientNum.ToString() + " - " + client.Name, true);
  10. counterX = 0;
  11. }
  12. }
  13.  
  14. }


OnChatSay
CSHARP Code
  1. if (Message == "!list")
  2. {
  3. counterX = 2 * 1000 / AddonFrameInterval;
  4. }

Please help
(01-06-2013, 18:48)koro35 Wrote: [ -> ]
CSHARP Code
  1. if (counterX == 2*1000 / AddonFrameInterval)
  2. {
  3. counterX++;
  4. foreach (ServerClient client in GetClients())
  5. {
  6. /**/
  7. }
  8. }

This hurts my head
lol? anyone can help?
(01-06-2013, 19:10)Ich1994 Wrote: [ -> ]
(01-06-2013, 18:48)koro35 Wrote: [ -> ]
CSHARP Code
  1. if (counterX == 2*1000 / AddonFrameInterval)
  2. {
  3. counterX++;
  4. foreach (ServerClient client in GetClients())
  5. {
  6. /**/
  7. }
  8. }

This hurts my head

(01-06-2013, 19:12)koro35 Wrote: [ -> ]lol? anyone can help?

Do you even understand what you coded there?
CSHARP Code
  1. foreach (ServerClient client in GetClients())
  2. {
  3. /**/
  4. }
That i know Big Grin
on chat say
CSHARP Code
  1. foreach (ServerClient client in GetClients())
  2. {
  3. if (counterX >= 1000 / AddonFrameInterval)
  4. {
  5. TellClient(Client.ClientNum, client.ClientNum.ToString() + " - " + client.Name, true);
  6. counterX = 0;
  7. }
  8. }
And onaddonframe i have it counterX++; am i anywhere close to the right code? (this only displays one name)

Still needs help D: