SA-MP Forums Archive
Votekick [+REP] - 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)
+--- Thread: Votekick [+REP] (/showthread.php?tid=552843)



Votekick [+REP] - arlindi - 26.12.2014

Hello i need a votekick system with /votekick [playerid] [reason]
and with command vote /yes and /no
Thank you


Re: Votekick [+REP] - M4D - 26.12.2014

https://sampforum.blast.hk/showthread.php?tid=549432
https://sampforum.blast.hk/showthread.php?tid=50119
https://sampforum.blast.hk/showthread.php?tid=175579
https://sampforum.blast.hk/showthread.php?tid=506766
https://sampforum.blast.hk/showthread.php?tid=256369
https://sampforum.blast.hk/showthread.php?tid=354673
https://sampforum.blast.hk/showthread.php?tid=175579

Search PLEASE


Re : Votekick [+REP] - AYOUYOU - 26.12.2014

Try This
pawn Код:
new VoteKick[MAX_PLAYERS],
    Vote[MAX_PLAYERS];

CMD:votekick(playerid, params[])
{
    new string[128], pname[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /votekick [playerid]");
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(id, targetname, sizeof(targetname));
    if(Vote[playerid] == 1) return SendClientMessage(playerid, -1, "You can only once vote kick!");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "You cannot votekick invalid/disconnected id!");
    if(id == playerid) return SendClientMessage(playerid, -1, "You cannot votekick yourself!");
    if(VoteKick[id] == 1)
    {
        format(string, sizeof(string), "%s(%d) vote to kick %s(%d) | Maxium Votekick: 3", pname, playerid, targetname, id);
        SendClientMessageToAll(-1, string);
        VoteKick[id]++;
        return 1;
    }
    if(VoteKick[id] == 3)
    {
        format(string, sizeof(string), "The vote kick has reach the maxium vote kick %s(%d) has been kicked!", targetname, id);
        SendClientMessageToAll(-1, string);
        VoteKick[id] = 0;
        Vote[playerid] = 0;
        Kick(id);
        return 1;
    }
    VoteKick[id]++;
    Vote[playerid]++;
    format(string, sizeof(string), "%s(%d) wants to kick %s(%d) /votekick to vote! | Maxium Votekick: 3", pname, playerid, targetname, id);
    SendClientMessageToAll(-1, string);
    format(string, sizeof(string), "You start a vote kick in %s(%d)", targetname, id);
    SendClientMessage(playerid, -1, string);
    format(string, sizeof(string), "%s(%d) wants you to be get kicked", pname, playerid);
    SendClientMessage(id, -1, string);
    return 1;
}



Re: Votekick [+REP] - arlindi - 27.12.2014

I am need it with /votekick [playerid][Reason]
and other players can vote /yes or /no
And if yes are more vote than no Kick player automaticly


Re: Votekick [+REP] - Luicy. - 27.12.2014

Gonna try Make a command now. BRB


Re: Re : Votekick [+REP] - Luicy. - 27.12.2014

Quote:
Originally Posted by AYOUYOU
Посмотреть сообщение
Try This
pawn Код:
new VoteKick[MAX_PLAYERS],
    Vote[MAX_PLAYERS];

CMD:votekick(playerid, params[])
{
    new string[128], pname[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /votekick [playerid]");
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(id, targetname, sizeof(targetname));
    if(Vote[playerid] == 1) return SendClientMessage(playerid, -1, "You can only once vote kick!");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "You cannot votekick invalid/disconnected id!");
    if(id == playerid) return SendClientMessage(playerid, -1, "You cannot votekick yourself!");
    if(VoteKick[id] == 1)
    {
        format(string, sizeof(string), "%s(%d) vote to kick %s(%d) | Maxium Votekick: 3", pname, playerid, targetname, id);
        SendClientMessageToAll(-1, string);
        VoteKick[id]++;
        return 1;
    }
    if(VoteKick[id] == 3)
    {
        format(string, sizeof(string), "The vote kick has reach the maxium vote kick %s(%d) has been kicked!", targetname, id);
        SendClientMessageToAll(-1, string);
        VoteKick[id] = 0;
        Vote[playerid] = 0;
        Kick(id);
        return 1;
    }
    VoteKick[id]++;
    Vote[playerid]++;
    format(string, sizeof(string), "%s(%d) wants to kick %s(%d) /votekick to vote! | Maxium Votekick: 3", pname, playerid, targetname, id);
    SendClientMessageToAll(-1, string);
    format(string, sizeof(string), "You start a vote kick in %s(%d)", targetname, id);
    SendClientMessage(playerid, -1, string);
    format(string, sizeof(string), "%s(%d) wants you to be get kicked", pname, playerid);
    SendClientMessage(id, -1, string);
    return 1;
}
Yea use that. It doesnt have /yes /no but one player does /votekick id then the others gonna do /votekick to vote Yes


Re: Votekick [+REP] - arlindi - 27.12.2014

I know thnx but i need it wiht yes or no