ban issue
#1

Hello I have a ban command with textdraw whenever I attempt to ban someone it sets me the textdraw instead of setting it to them it still bans them though could anyone have a look and see whats wrong?
Код:
CMD:ban(playerid, params[])
{
    new targetid, reason[105], string[180], stringbig[256] , YEAR_string[5], Year, Month, Day, pName2[MAX_PLAYER_NAME];
    if(pInfo[playerid][pAdminLevel] >= 2)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsPlayerNPC(targetid))
            {
       	    	getdate(Year, Month, Day);
				if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, ""chat" Player is not online");
 				if(sscanf(params, "us[105]", targetid, reason)) return SendClientMessage(playerid, -1, ""chat" /ban [playerid] [reason]");
	            if(pInfo[targetid][pAdminLevel] >= 1)
				{
	    			SendClientMessage(playerid, -1, ""chat""COL_RED" You can't ban a admin!");
    			}
				else if(pInfo[targetid][pAdminLevel] <= 1)
				{
	    			format(string, sizeof(string), "SERVER: "COL_RED"%s "COL_GREEN"has been banned "COL_RED"(Reason: %s)",pName, reason);
				    SendMessageToAllAdmins(string, -1)
				    format(YEAR_string, sizeof(YEAR_string), "%d", Year);
				    strdel(YEAR_string, 0, 2);
			     	format(stringbig, sizeof(stringbig),"~r~Reason: ~w~ %s ~n~~r~Banned By: ~w~ %s ~n~~r~Date: ~w~ %d/%d/%s",reason,pName,Month, Day, YEAR_string);
			  		PlayerTextDrawSetString(playerid,Info[targetid],stringbig);
					PlayerTextDrawShow(playerid, Info[targetid]);
					PlayerTextDrawShow(playerid, Box[targetid]);
					PlayerTextDrawShow(playerid, BannedNotice[targetid]);
					PlayerTextDrawShow(playerid, Site[targetid]);
					BanPlayer(targetid, reason, PlayerName(playerid));
				}
			}
			else
			{
			    SendClientMessage(playerid, -1, ""chat""COL_RED" You cannot ban an NPC");
			}
		}
	}
	else
	{
		SendClientMessage(playerid, -1, ""chat""COL_RED" You do not have the right admin permissions for this command!");
	}
	return 1;
}
Thanks in advanced.
Reply
#2

I thing that you need to use : "PlayerTextDrawSetString(targetid...) not playerid because that means to show to you not to banned player. And also other playertextdraw.. with targetid..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)