[Pomoc] /ban cmd


Započeo Jhony Walker, Septembar 08, 2012, 16:01:06 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:DV RP
Detaljan opis problema:Pa ja ocu ako netko od admina pokusa ban ownera da owneru dodje to recimo "%s vas je pokusao banat"
Dio skripte:
//--------------------------------------[Ban]----------------------------------------------------
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
			   

Ovo je taj dio
if(IsPlayerConnected(giveplayerid))
			    {
					if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Ne mozete banovati ownera");
						SendAdminMessage(COLOR_YELLOW, string);
						format(string, sizeof(string), "%s je pokusao banati ownera !", sendername);
						return 1;
					}

Ovo je sve
//--------------------------------------[Ban]----------------------------------------------------
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Ne mozete banovati ownera");
						SendAdminMessage(COLOR_YELLOW, string);
						format(string, sizeof(string), "%s je pokusao banati ownera !", sendername);
						return 1;
					}
			        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, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "[BRPG]: Admin %s je banao %s, razlog: %s ", sendername, giveplayer, (result));
						BanLog(string);
						format(string, sizeof(string), "[BRPG]: Admin %s je banao %s, razlog: %s ", sendername, giveplayer, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						PlayerInfo[giveplayerid][pLocked] = 1;
						Ban(giveplayerid);
						return 1;
					}
				}//not connected
			}
			else
			{
				format(string, sizeof(string), " Nemate dozvolu da upotrijebite komandu /ban !");
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno): http://www.zaslike.com/viewer.php?file=twg3nu2o1izndm6b0pf.png

//--------------------------------------[Ban]----------------------------------------------------
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Ne mozete banovati ownera");
						SendAdminMessage(COLOR_YELLOW, string);
						format(string, sizeof(string), "%s je pokusao banati ownera !", sendername);
SendClientMessage(giveplayerid,-1,string);
						return 1;
					}
			        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, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "[BRPG]: Admin %s je banao %s, razlog: %s ", sendername, giveplayer, (result));
						BanLog(string);
						format(string, sizeof(string), "[BRPG]: Admin %s je banao %s, razlog: %s ", sendername, giveplayer, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						PlayerInfo[giveplayerid][pLocked] = 1;
						Ban(giveplayerid);
						return 1;
					}
				}//not connected
			}
			else
			{
				format(string, sizeof(string), " Nemate dozvolu da upotrijebite komandu /ban !");
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Poslednja Izmena: Septembar 08, 2012, 16:12:39 POSLE PODNE od Daniel Zero
ODSUTAN


//--------------------------------------[Ban]----------------------------------------------------
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Ne mozete banovati ownera");
						SendAdminMessage(COLOR_YELLOW, string);
						format(string, sizeof(string), "%s je pokusao banati ownera !", GetPlayerName(playerid));
SendClientMessage(giveplayerid,-1,string);
						return 1;
					}
			        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, "Koriscenje: /ban [ID Igraca/Dio Imena] [razlog]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "[BRPG]: Admin %s je banao %s, razlog: %s ", sendername, giveplayer, (result));
						BanLog(string);
						format(string, sizeof(string), "[BRPG]: Admin %s je banao %s, razlog: %s ", sendername, giveplayer, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						PlayerInfo[giveplayerid][pLocked] = 1;
						Ban(giveplayerid);
						return 1;
					}
				}//not connected
			}
			else
			{
				format(string, sizeof(string), " Nemate dozvolu da upotrijebite komandu /ban !");
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	} 
ODSUTAN