Jump to content

Question

Posted

Am comenzile astea la ban si unban

//-----------------------------Unban-------------------------------------------
    if(strcmp(cmd, "/unban", true)==0)
	{
		if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 4)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, 0xA8A8FFFF, "USAGE: /unban [PlayerName]");
				return 1;
			}
   			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
			ABroadCast(COLOR_YELLOW,string,1);
			format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
			format(string,sizeof(string),"%s.ini",tmp);
			dini_IntSet(string, "Blocat", 0);
			SendClientMessage(playerid, COLOR_WHITE, "Player Unbanned");
		}
		return 1;
	}
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "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_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
						BanLog(string);
						format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						new playersip[256];
						GetPlayerIp(giveplayerid,playersip, sizeof(playersip));
					    SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[BAN INFO]___________|");
			            format(string, sizeof(string), "Numele tau este: %s.",giveplayer);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "IP-ul tau este: %s.",playersip);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Ai fost banat de: %s.",sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Ai fost banat pentru urmatorul motiv: %s.",(result));
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Ai fost banat pe data de: %d/%d/%d (Ziua-Luna-Anul)",day,month,year);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[BAN INFO]___________|");
                        SendClientMessage(giveplayerid,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este www.blackrockk.eu Succes !");
                        SendClientMessage(giveplayerid,COLOR_WHITE,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza !");
						PlayerInfo[giveplayerid][pBlocat] = 1;
						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;
	}

Cand intru unde am useri si modificat la blocat din 1 in 0 merge perfect dar cand dau unban din game i sa schimba parola la playerul pe care il debanez plz help spuneti ce am gresit in comanda de unban.

4 answers to this question

Recommended Posts

Posted

frate stiu ce zic :) calm  e o problema in comanda unban ori e pus ceva in plus ori lipseste ceva. Cand intru la useri acolo si modific la Blocat din 1 in 0 merge perfect nu se schimba parola cand dau unban din game se schimba parola la contu respectiv.

Posted

if (strcmp(cmd, "/unban", true)==0)
	{
		if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, 0xA8A8FFFF, "USAGE: /unban [PlayerName]");
				return 1;
			}
   			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
			ABroadCast(COLOR_YELLOW,string,1);


			format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
			printf(string);
			format(string,sizeof(string),"%s.ini",tmp);
			dini_IntSet(string, "Banned", 0);
		    dini_IntSet(string, "Warnings", 0);
			fremove(string);
			SendClientMessage(playerid, COLOR_WHITE, "Player Unbanned");
		}
		return 1;
	}
    if(strcmp(cmd,"/unbanip",true)==0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 1338)
		{
		    tmp = strtok(cmdtext,idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]");
		        return 1;
   			}

			format(string,sizeof(string),"unbanip %s",tmp);
			SendRconCommand(string);
			SendRconCommand("reloadbans");
   			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "AdmWarning: Admin %s has unbanned IP %s", sendername,tmp);
			ABroadCast(COLOR_YELLOW,string,1);
			BanLog(string);
		}
		return 1;
	}

vezi poate asta e mai bun e din gm meu nu zonek nu alte porcarii

mca.png
Posted

stefanel994, data viitoare iei warn. Probleme godfather/roleplay se posteaza aici: http://www.sa-mp.ro/forum/index.php/topic,5356.0.html

Mandela, data viitoare nu-i mai ajuta cand posteaza inafara topicului pentru godfather/roleplay.

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.