SA-MP Forums Archive
A Little Help Please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A Little Help Please (/showthread.php?tid=68609)



A Little Help Please - notec100 - 11.03.2009

I am having an issue on my server where players constantly DM regardless of what the sdmins say, they just keep doing it. The admins do not want to just be all ban crazy and dicks but I was wondering if I could make a sort of check to see if a player kills 5 people within a 3 minute period they will be kicked and receive a message like **You have been kicked for constant DM. This is not a DM server, if you want to DM take yourself to another server.** I know that this will require a timer and everything, but I do not know how I would set this all up so help is appreciated. Thanks in advance!


Re: A Little Help Please - ICECOLDKILLAK8 - 11.03.2009

pawn Код:
// Top Of Script
new KillsTimer;
new Kills[MAX_PLAYERS];
// OnGameModeInit
KillsTimer = SetTimer("ResetKills", 180 000, 1);
// OnGameModeExit
KillTimer(KillsTimer);
// OnPlayerDeath
Kills[killerid]++;
if(Kills[killerid] == 5)
{
  SendClientMessage(killerid, COLOR_RED, "GTFO");
  TogglePlayerControllable(killerid, 0);
  Kick(killerid);
}
// Bottom Of Script
public ResetKills()
{
  for(new i; i < MAX_PLAYERS; i++)
  {
    Kills[i] = 0;
  }
  return 1;
}
Try that, Not tested but should work


Re: A Little Help Please - Mikep - 11.03.2009

TogglePlayerControllable(killerid, 0);

Bit random?


Re: A Little Help Please - ICECOLDKILLAK8 - 12.03.2009

Quote:
Originally Posted by Mikep
TogglePlayerControllable(killerid, 0);

Bit random?
So they cant have fun running around after they have been kicked lol


Re: A Little Help Please - Mikep - 12.03.2009

Oh right, nice idea. *evil laugh*


Re: A Little Help Please - notec100 - 12.03.2009

Kick ass thanks I will implement it then post any errors, but it looks pretty good to me thanks again guys!