SA-MP Forums Archive
[Include] Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) (/showthread.php?tid=469857)



Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - xganyx - 15.10.2013

Hello guys this is my first include and hope you like it

this is a simple include to Kick, Ban/Unban, Mute/Unmute, Freeze/Unfreeze with function

new version v2.1 fixed bugs and add SendMessage

to use this include, add the #include <Extra> in your script, exemple:

pawn Код:
#include <a_samp>
#include <Extra>
#include <core>
#include <sscanf2>
#include <float>
#include <zcmd>
//....
Function

pawn Код:
native Extra_Kick(playerid, reason[]);
native Extra_Ban(playerid, reason[]);
native Extra_UnBan(playername);
native Extra_Mute(playerid, reason[]);
native Extra_UnMute(playerid, reason[]);
native Extra_Freeze(playerid, reason[]);
native Extra_UnFreeze(playerid, reason[]);
Download

Extra.inc v2.1 Pastebin
Extra.inc Pastebin

Exemple script

pawn Код:
/****************
    Exemple script
******************/


#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <extra>

CMD:ban(playerid, params[])
{
    new id,reasontext[100];
    if(sscanf(params,"us[100]",id,reasontext)) return SendClientMessage(playerid,-1,"USAGE: /ban [playerid] [reason]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"That player is not connected to server");
    Extra_Ban(id,reasontext);
    return 1;
}
Credits:
Код:
Dracoblue
_Emmet - show me the bugs
Me (WazzUp)



Respuesta: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - Swedky - 15.10.2013

Wow! Is really nice!

+Rep


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - shittt - 15.10.2013

Good Job .





reputeishon .


AW: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - BigETI - 15.10.2013

It's largely copied from DINI. Shame on you at not giving any credits to Dracoblue and also modifying the function names.


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - xganyx - 16.10.2013

sr forgot the credit


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - Juniiro3 - 16.10.2013

Good!

2reps


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - Rocky Racoon - 16.10.2013

Good work.


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - iZN - 16.10.2013

It's example not exemple.


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - Emmet_ - 16.10.2013

pawn Код:
stock Extra_Ban(playerid, reason[])
{
        SendClientMessage(playerid,-1,reason);
        Banned[playerid] = 1;
        new file[200];
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Ban",1);
        SetTimer("KickPlayer",3000,false);
        return 1;
}
Why are you using 200 cells for something that would only need about ~35 cells?

pawn Код:
stock Extra_UnBan(playername[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",playername);
        Extra_IntSet(file,"Ban",0);
        return 1;
}
 
stock Extra_Mute(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Mute",1);
        Muted[playerid] = 1;
        return 1;
}
 
stock Extra_UnMute(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Mute",0);
        Muted[playerid] = 0;
        return 1;
}
 
stock Extra_Freeze(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Freeze",1);
        Freezed[playerid] = 1;
        TogglePlayerControlLabel(playerid,0);
        return 1;
}
 
stock Extra_UnFreeze(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Freeze",0);
        Freezed[playerid] = 0;
        TogglePlayerControlLabel(playerid,1);
        return 1;
}
Those functions won't even compile.


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - Jardell - 16.10.2013

good job, boy.


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - xganyx - 17.10.2013

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
pawn Код:
stock Extra_Ban(playerid, reason[])
{
        SendClientMessage(playerid,-1,reason);
        Banned[playerid] = 1;
        new file[200];
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Ban",1);
        SetTimer("KickPlayer",3000,false);
        return 1;
}
Why are you using 200 cells for something that would only need about ~35 cells?

pawn Код:
stock Extra_UnBan(playername[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",playername);
        Extra_IntSet(file,"Ban",0);
        return 1;
}
 
stock Extra_Mute(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Mute",1);
        Muted[playerid] = 1;
        return 1;
}
 
stock Extra_UnMute(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Mute",0);
        Muted[playerid] = 0;
        return 1;
}
 
stock Extra_Freeze(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Freeze",1);
        Freezed[playerid] = 1;
        TogglePlayerControlLabel(playerid,0);
        return 1;
}
 
stock Extra_UnFreeze(playerid, reason[])
{
        new file[200]
        format(file,sizeof(file),"Extra/%s.ini",GetName(playerid));
        Extra_IntSet(file,"Freeze",0);
        Freezed[playerid] = 0;
        TogglePlayerControlLabel(playerid,1);
        return 1;
}
Those functions won't even compile.
Fixed. And thanks everyone


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - TheChimpJr - 17.10.2013

Not bad.


Re: Extra.inc - Kick, Ban, Mute, Freeze With Message (Hooked version) (My first include) - xganyx - 18.10.2013

Thanks .