Jump to content
  • 0

[GF/RP] Problema /ban


Question

Posted

Cum fac ca adminul 1 sa nu poata da ban la adminul 1338?

Sau mai bine zis adminul mic nu poate da ban la un admin mai mare?

Please help.

Uitati aici comanda /ban daca va este de ajutor

if(strcmp(cmd, "/ban", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
                        {
                                SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid/PartOfName] [reason]");
                                return 1;
                        }
                        giveplayerid = ReturnUser(tmp);
                        if (PlayerInfo[playerid][pAdmin] >= 1)
                        {
                            if(IsPlayerConnected(giveplayerid))
                            {
                                if(giveplayerid != INVALID_PLAYER_ID)
                                {
                                            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                                new length = strlen(cmdtext);
                                                while ((idx < length) && (cmdtext[idx] <= ' '))
                                                {
                                                        idx++;
                                                }
                                                new offset = idx;
                                                new result[64];
                                                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                                                {
                                                        result[idx - offset] = cmdtext[idx];
                                                        idx++;
                                                }
                                                result[idx - offset] = EOS;
                                                if(!strlen(result))
                                                {
                                                        SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid/PartOfName] [reason]");
                                                        return 1;
                                                }
                                                new year, month,day;
                                                getdate(year, month, day);
                                                format(string,128,"AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result), month, day, year);
                                                SendClientMessageToAll(COLOR_RED,string);
                                                BanLog(string);
                                                PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
                                                PlayerInfo[giveplayerid][pLevel] = -999;
                                                format(string, sizeof(string), "Information: %s was banned by %s, reason: %s\nReclamation: rpgaming.forumz.Ro", giveplayer, sendername, result);
                                                ShowPlayerDialog(giveplayerid, 0, DIALOG_STYLE_MSGBOX, "You have been Banned", string, "Ok", "Quit");
                                                Ban(giveplayerid);
                                                return 1;
                                        }
                                }//not connected
                        }
                        else
                        {
                                format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                                SendClientMessage(playerid, COLOR_GRAD1, string);
                        }
                }
                return 1;
        }

1 answer to this question

Recommended Posts

Posted

Asa;

Adaugi acest forward

forward IsAFounder(playerid);
Creezi publicul asta
public IsAFounder(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    if(PlayerInfo[playerid][pAdmin] >= 1338)
		{
		    return 1;
		}
	}
	return 0;
}
Iar la comanda /ban adaugi
if(IsAFounder(giveplayerid))
			        	{
			        	    SendClientMessage(playerid, COLOR_WHITE, "Nu poti Bana un Owner");
			        	    return 1;
						}

<a href="http://www.userbars.be"><img src="http://img534.imageshack.us/img534/9098/36589.gif" alt="Free userbars" border="0"></a>

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.