Poll

Do you like this command??

Yes is great
6 (54.5%)
Awesome
2 (18.2%)
Not bad
2 (18.2%)
I do not like
1 (9.1%)

Total Members Voted: 9

Voting closed: November 18, 2013, 10:22:04 pm

Author Topic: Votekick, Command (is the one of a kind in vcmp)  (Read 4435 times)

0 Members and 1 Guest are viewing this topic.

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Votekick, Command (is the one of a kind in vcmp)
« on: August 10, 2013, 10:20:31 pm »
[pawn]new Xp[256], VoteKick[MAX_PLAYERS];
new file[ 128 ];[/pawn]



[pawn]                        else if (strcmp(cmd, "!votekick", true) == 0) {
            tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
      if (!strlen(tmp)) SendClientMessage(playerid, 0x333AFFF,"Write: !votekick <name/id>");
        else
        {
                        if(VoteKick[playerid] == 1)
            {
   SendClientMessage(playerid,0xAA3333AA,"You already Vote");
}
                        if(VoteKick[playerid] == 0) {

          format( szMsg, sizeof( szMsg ), "Player [%s] calls votekick for  [%s] ",gPlayers[playerid],gPlayers[plr]);
                  SendClientMessageToAll(0x333AFFF, szMsg );
                      format( szMsg, sizeof( szMsg ), "For Vote Write !votekick %s",gPlayers[plr]);
                  SendClientMessageToAll(0x333AFFF, szMsg );
                  DarVoteKick(plr,1);
                     SetTimer( "Votando", 120000,false);
                  VoteKick[playerid] = 1;
          format( szMsg, sizeof( szMsg ), "VoteKick [%s], [%s] ",gPlayers[plr],VoteKickLevel(ObtenerVoteKick(plr)));
                  SendClientMessageToAll(0x333AFFF, szMsg );
                  }
                                               if (ObtenerVoteKick(plr) == 5)
           {
           Kick(plr);
                format( szMsg, sizeof( szMsg ), "Player [%s] Is kicked Reason [VoteKick]",gPlayers[plr]);
                  SendClientMessageToAll(0xAA3333FF, szMsg );
                  SetTimer( "VotoBorrado", 5000,false);
        KillTimer(120000);
                 
           }
           }
                  return 1;
                  }[/pawn]

[pawn]//==============================================================================
public VotoBorrado() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(VoteKick == 1) {
SendClientMessage(i,0x0FCD18FF,"Now You Cant Vote Again");
VoteKick = 0;
}
}
}
}
//==============================================================================
public Votando() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
SendClientMessage(i,0x0FCD18FF,"VoteKick is canceled 2 minutes passed");
QuitaVoteKick(i);
VoteKick = 0;
}
}
}
//==============================================================================
public ObtenerVoteKick(playerid)
{
    format(Xp,256, REGISTROS, gPlayers[playerid]); //Please change "REGISTROS" and put your folder name of registers
   new vote; vote = dini_Int(Xp,"VoteKick");
   return vote;
}
public DarVoteKick( playerid, Amount )
{
   format( file, sizeof( file ), REGISTROS, gPlayers[ playerid ] ); //Please change "REGISTROS" and put your folder name of registers
   new votekick; votekick = dini_Int( file, "VoteKick" );
   dini_IntSet( file, "VoteKick", votekick +Amount);
}
public QuitaVoteKick(playerid)
{
    format(Xp,256, REGISTROS, gPlayers[playerid]); //Please change "REGISTROS" and put your folder name of registers
   dini_Unset(Xp,"VoteKick");
}
//==============================================================================
public VoteKickLevel(level)
{
   new lvl[256];
    if (level == 1) lvl = "1";
   if (level == 2) lvl = "2";
    if (level == 3) lvl = "3";
    if (level == 4) lvl = "4";
   else if (level == 5) lvl = "5";
   return lvl;
}
//================================================
[/pawn]

This Command is for make a vote and if the player have 5 vote es automatic kicked



« Last Edit: August 10, 2013, 10:41:27 pm by aledark24 »
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline [AoD]NC

  • VC:MP Beta Tester
  • VC:MP Veteran
  • *
  • Posts: 616
  • AoD forever!
    • View Profile
    • KURWA MAĆ
Re: Votekick, Command (is the one of a kind in vcmp)
« Reply #1 on: August 11, 2013, 12:59:22 am »
[BlackWarrior] is exited of the server (Kicked/Banned)
wut?

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Votekick, Command (is the one of a kind in vcmp)
« Reply #2 on: August 11, 2013, 10:00:34 am »
Yeah nice one but could u edit it to allow players vote for kick or not for kick (like: "!vote y/n")? For example if there's only 3 players and one of them is hacking, the dudes that voted are only 2, not 5. So if the dude that is hacking gets more votes for being kicked, he will be, or if not - he will not. :)


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Votekick, Command (is the one of a kind in vcmp)
« Reply #3 on: August 11, 2013, 02:30:28 pm »
It sounds stupid to me that if 2 players are on the server and they do !votekick on another guy ( 3 players ) that guy will never be kicked.


You could do an average of the players ( I suppose they teach that in Spain in your grade ) and then use it at the max players instead of 5.

And no it's not one of a kind, lots of people done it before you including me.
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Votekick, Command (is the one of a kind in vcmp)
« Reply #4 on: August 11, 2013, 04:12:18 pm »
And no it's not one of a kind, lots of people done it before you including me.

Why you guys are pointing this so much ? It was done before, I'm sure about this, but no one posted it ! Do you see it on the VC:MP Forums ? because I don't.

I hope it works good, because scripters may try to learn from it. ;)



By the way, players will start to vote Yes just to be bad, to have their own ridiculous fun.

I suggest you to make this command just for admins, so if on the server will be connected just 2 players, one of them should be an admin, and it not make any sense to request a VoteKick since him can kick the "bad" player with kick command.



and shadow is right with this suggestion:

You could do an average of the players and then use it at the max players instead of 5.

or just more than a half. (and maybe you add and some variables, to cannot start the kick vote when are just less than 5 players connected)

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline omersami2

  • Street Thug
  • *
  • Posts: 5
    • View Profile
Re: Votekick, Command (is the one of a kind in vcmp)
« Reply #5 on: November 29, 2013, 01:44:05 am »
[pawn]new Xp[256], VoteKick[MAX_PLAYERS];
new file[ 128 ];[/pawn]



[pawn]                        else if (strcmp(cmd, "!votekick", true) == 0) {
            tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
      if (!strlen(tmp)) SendClientMessage(playerid, 0x333AFFF,"Write: !votekick <name/id>");
        else
        {
                        if(VoteKick[playerid] == 1)
            {
   SendClientMessage(playerid,0xAA3333AA,"You already Vote");
}
                        if(VoteKick[playerid] == 0) {

          format( szMsg, sizeof( szMsg ), "Player [%s] calls votekick for  [%s] ",gPlayers[playerid],gPlayers[plr]);
                  SendClientMessageToAll(0x333AFFF, szMsg );
                      format( szMsg, sizeof( szMsg ), "For Vote Write !votekick %s",gPlayers[plr]);
                  SendClientMessageToAll(0x333AFFF, szMsg );
                  DarVoteKick(plr,1);
                     SetTimer( "Votando", 120000,false);
                  VoteKick[playerid] = 1;
          format( szMsg, sizeof( szMsg ), "VoteKick [%s], [%s] ",gPlayers[plr],VoteKickLevel(ObtenerVoteKick(plr)));
                  SendClientMessageToAll(0x333AFFF, szMsg );
                  }
                                               if (ObtenerVoteKick(plr) == 5)
           {
           Kick(plr);
                format( szMsg, sizeof( szMsg ), "Player [%s] Is kicked Reason [VoteKick]",gPlayers[plr]);
                  SendClientMessageToAll(0xAA3333FF, szMsg );
                  SetTimer( "VotoBorrado", 5000,false);
        KillTimer(120000);
                 
           }
           }
                  return 1;
                  }[/pawn]

[pawn]//==============================================================================
public VotoBorrado() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(VoteKick == 1) {
SendClientMessage(i,0x0FCD18FF,"Now You Cant Vote Again");
VoteKick = 0;
}
}
}
}
//==============================================================================
public Votando() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
SendClientMessage(i,0x0FCD18FF,"VoteKick is canceled 2 minutes passed");
QuitaVoteKick(i);
VoteKick = 0;
}
}
}
//==============================================================================
public ObtenerVoteKick(playerid)
{
    format(Xp,256, REGISTROS, gPlayers[playerid]); //Please change "REGISTROS" and put your folder name of registers
   new vote; vote = dini_Int(Xp,"VoteKick");
   return vote;
}
public DarVoteKick( playerid, Amount )
{
   format( file, sizeof( file ), REGISTROS, gPlayers[ playerid ] ); //Please change "REGISTROS" and put your folder name of registers
   new votekick; votekick = dini_Int( file, "VoteKick" );
   dini_IntSet( file, "VoteKick", votekick +Amount);
}
public QuitaVoteKick(playerid)
{
    format(Xp,256, REGISTROS, gPlayers[playerid]); //Please change "REGISTROS" and put your folder name of registers
   dini_Unset(Xp,"VoteKick");
}
//==============================================================================
public VoteKickLevel(level)
{
   new lvl[256];
    if (level == 1) lvl = "1";
   if (level == 2) lvl = "2";
    if (level == 3) lvl = "3";
    if (level == 4) lvl = "4";
   else if (level == 5) lvl = "5";
   return lvl;
}
//================================================
[/pawn]

This Command is for make a vote and if the player have 5 vote es automatic kicked




Nice Work Man I Appreciate Your Work