SA-MP Forums Archive
[HELP]ban with no reason? - 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: [HELP]ban with no reason? (/showthread.php?tid=516816)



[HELP]ban with no reason? - virtuxx - 01.06.2014

there is a code:

Код:
COMMAND:ban(playerid, params[])
{
	new pid;
	new string[900];
	if(sscanf(params, "us", pid, params[2])) return SendClientMessage(playerid, 0xFF0000AA, "Utilizzo corretto: /banna [id] [motivo/specifica l'uso]");
	if(level[playerid] >= 3)
	{
		if(level[playerid] < level[pid]) return SendClientMessage(playerid, red, "You can't use this command on a higher level Admin!");
	    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, red, "ERROR: That player is not online.");
		new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
		new playerfile[100], pname[MAX_PLAYER_NAME];
		GetPlayerName(pid, pname, sizeof(pname));
		format(playerfile, sizeof(playerfile), "admin/Users/%s.ini",pname);
		if(dini_Exists(playerfile))
		{
		dini_IntSet(playerfile, "Banned", 1);
		}
		SendClientMessage(playerid, red, "================================================================================================");
		SendClientMessage(playerid, red, "You have been banned in this server, if you think this is an error, post a ban appeal to www.impulsive-gaming.forumfree.net severance or contact me on skype severance98!");
        SendClientMessage(playerid, red, "================================================================================================");
		GetPlayerName(pid, paramname, sizeof(paramname));
		GetPlayerName(playerid, adminname, sizeof(adminname));
		format(string, sizeof(string), "*** Admin %s has banned %s reason: %s ", adminname, paramname, params[2]);
		SendClientMessageToAll(red, string);
		adminlog(string);
		BanEx(pid,"string");
	} else SendClientMessage(playerid, red, "*** we need higher admin to use this command ! ***");
	return 1;
}
pls can help me?


Re: [HELP]ban with no reason? - AiRaLoKa - 02.06.2014

i don't understand with what you want but maybe this is what you want...
pawn Код:
COMMAND:ban(playerid, params[])
{
    new pid;
    new string[900];
    if(sscanf(params, "u", pid)) return SendClientMessage(playerid, 0xFF0000AA, "Utilizzo corretto: /ban [id]");
    if(level[playerid] >= 3)
    {
        if(level[playerid] < level[pid]) return SendClientMessage(playerid, red, "You can't use this command on a higher level Admin!");
        if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, red, "ERROR: That player is not online.");
        new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
        new playerfile[100], pname[MAX_PLAYER_NAME];
        GetPlayerName(pid, pname, sizeof(pname));
        format(playerfile, sizeof(playerfile), "admin/Users/%s.ini",pname);
        if(dini_Exists(playerfile))
        {
            dini_IntSet(playerfile, "Banned", 1);
        }
        SendClientMessage(playerid, red, "================================================================================================");
        SendClientMessage(playerid, red, "You have been banned in this server, if you think this is an error, post a ban appeal to http://www.impulsive-gaming.forumfree.net severance or contact me on skype severance98!");
        SendClientMessage(playerid, red, "================================================================================================");
        GetPlayerName(pid, paramname, sizeof(paramname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        format(string, sizeof(string), "*** Admin %s has banned %s", adminname, paramname);
        SendClientMessageToAll(red, string);
        adminlog(string);
        BanEx(pid,"string");
    } else SendClientMessage(playerid, red, "*** we need higher admin to use this command ! ***");
    return 1;
}



Re: [HELP]ban with no reason? - RowdyrideR - 02.06.2014

Not sure, didn't read the whole code, But I think your problem is that the player doesn't get the ban reason text?
If so, try to use a timer like a second after the player detected to ban him. Put the ban command in the timer.


Re: [HELP]ban with no reason? - AiRaLoKa - 02.06.2014

i don't understand with what he want. Is he want to change the ban command into without reason or he got a problem with his command