Рекомендованные сообщения



2 posts in this topic

 

Спойлер

CMD:players(playerid, params[])
{
	if(pInfo[playerid][pAdmin] >= 6)
	{
		if(!gAdminLogged[playerid]) return SCM(playerid, COLOR_GREY, YouAreNotLoggedInAsAdmin);
		else if(sscanf(params, "d", params[0])) return SCM(playerid, COLOR_WHITE, "Введите: /players [id игрока]");
		else if(params[0] == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
		else if(!gPlayerLogged[params[0]]) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
		//SetPVarInt(playerid, "Players", targetid);
		format(stringer, sizeof(stringer),"{FFFFFF}Тип наказания игрока: %s {00CC00}[ID: %d]", pInfo[params[0]][pName], params[0]);
		SPD(playerid, dPlayers, DIALOG_STYLE_LIST, stringer, "{FFFFFF}\
		NonRP\n\
		NonRP Угон\n\
		NonRP Drive\n\
		NonRP Nick\n\
		DM\n\
		DB\n\
		ПДД\n\
		Флуд в /ad\n\
		Дебош\n\
		Caps Lock\n\
		SK\n\
		MG\n\
		TK", "Ок", "Закрыть");
	}
	return 1;
}

 

в OnDialogResponse

Спойлер

	case dPlayers:
	    {
	        new targetid = GetPVarInt(playerid, "Players");
	        if(!response) return DeletePVar(playerid, "Players");
			switch(listitem)
			{
			    case 0: // NonRP
			    {
			        if(pInfo[targetid][pMuted] > 0) return SCM(playerid, COLOR_GREY, "Игрок уже имеет бан чата!");
					{
						ResetPlayerWeaponsEx(targetid);
						pInfo[targetid][pJailTime] = 2*900;
						if(pCuff[targetid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[targetid][pCuffer];
							SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(targetid, 0);
							pCuff[targetid][pCuffer] = pCuff[targetid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 25 минут. Причина: NonRP", GetName(playerid), GetName(targetid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(targetid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(targetid, -90.0000);
						SetPlayerInterior(targetid, 1);
						SetPlayerVirtualWorld(targetid, 1);
						SetCameraBehindPlayer(targetid);
					    SetVehicleToRespawn(GetPlayerVehicleID(targetid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[targetid][pJailTime]);
						GameTextForPlayer(targetid, stringer, 3000, 3);
						pInfo[targetid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[targetid][pJail], pInfo[targetid][pJailTime], pInfo[targetid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 1: // NonRP Угон
			    {
			        if(pInfo[targetid][pMuted] > 0) return SCM(playerid, COLOR_GREY, "Игрок уже имеет бан чата!");
					{
	                    ResetPlayerWeaponsEx(targetid);
						pInfo[targetid][pJailTime] = 2*600;
						if(pCuff[targetid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[targetid][pCuffer];
							SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(targetid, 0);
							pCuff[targetid][pCuffer] = pCuff[targetid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 20 минут. Причина: NonRP Угон", GetName(playerid), GetName(targetid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(targetid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(targetid, -90.0000);
						SetPlayerInterior(targetid, 1);
						SetPlayerVirtualWorld(targetid, 1);
						SetCameraBehindPlayer(targetid);
					    SetVehicleToRespawn(GetPlayerVehicleID(targetid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[targetid][pJailTime]);
						GameTextForPlayer(targetid, stringer, 3000, 3);
						pInfo[targetid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[targetid][pJail], pInfo[targetid][pJailTime], pInfo[targetid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 2: // NonRP Drive
			    {
			        if(pInfo[targetid][pJail] == 4) return SCM(playerid, COLOR_GREY, "Игрок уже находиться в деморгане!");
					{
	                	ResetPlayerWeaponsEx(targetid);
						pInfo[targetid][pJailTime] = 3*600;
						if(pCuff[targetid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[targetid][pCuffer];
							SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(targetid, 0);
							pCuff[targetid][pCuffer] = pCuff[targetid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 30 минут. Причина: NonRP Drive", GetName(playerid), GetName(targetid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(targetid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(targetid, -90.0000);
						SetPlayerInterior(targetid, 1);
						SetPlayerVirtualWorld(targetid, 1);
						SetCameraBehindPlayer(targetid);
					    SetVehicleToRespawn(GetPlayerVehicleID(targetid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[targetid][pJailTime]);
						GameTextForPlayer(targetid, stringer, 3000, 3);
						pInfo[targetid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[targetid][pJail], pInfo[targetid][pJailTime], pInfo[targetid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 3: // NonRP Nick
			    {
					if(pInfo[targetid][pMuted] > 0) return SCM(playerid, COLOR_GREY, "Игрок уже имеет бан чата!");
			    	{
	     				format(stringer, sizeof(stringer), "Администратор %s кикнул игрока %s. Причина: NonRP Nick", pInfo[playerid][pName], pInfo[targetid][pName]);
						SCMTA(COLOR_RED, stringer);
						DeletePVar(playerid, "Players");
						Kick(targetid);
					}
			    }
			    case 4: // DM
			    {
			        if(pInfo[targetid][pJail] == 4) return SCM(playerid, COLOR_GREY, "Игрок уже находиться в деморгане!");
					{
						ResetPlayerWeaponsEx(targetid);
						pInfo[targetid][pJailTime] = 6*600;
						if(pCuff[targetid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[targetid][pCuffer];
							SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(targetid, 0);
							pCuff[targetid][pCuffer] = pCuff[targetid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 60 минут. Причина: DM", GetName(playerid), GetName(targetid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(targetid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(targetid, -90.0000);
						SetPlayerInterior(targetid, 1);
						SetPlayerVirtualWorld(targetid, 1);
						SetCameraBehindPlayer(targetid);
					    SetVehicleToRespawn(GetPlayerVehicleID(targetid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[targetid][pJailTime]);
						GameTextForPlayer(targetid, stringer, 3000, 3);
						pInfo[targetid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[targetid][pJail], pInfo[targetid][pJailTime], pInfo[targetid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 5: // DB
			    {
					pInfo[targetid][pTimeToLastWarn] = gettime();
					pInfo[targetid][pWarn]++;
  					new string[144];
					if(pInfo[targetid][pWarn] > 2)
					{
						format(string, sizeof(string), "Администратор %s выдал предупреждение игроку %s [%i/3]. Причина: DB. Акк заблок. на 10 дней", GetName(targetid), GetName(targetid), pInfo[targetid][pWarn]);
				        mysql_query_string[0] = EOS;
						format(mysql_query_string, sizeof(mysql_query_string), "INSERT INTO "T_BANS" (name,whobanned,ip,bandate,time,unbandate,reason) VALUES ('%s','%s','%s',CURDATE(),10,CURDATE() + INTERVAL 10 DAY,'%s')", GetName(targetid), GetName(targetid), pInfo[targetid][pIP]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						pInfo[targetid][pWarn] = 0;
					}
					else format(string, sizeof(string), "Администратор %s выдал предупреждение игроку %s [%i/3]. Причина: DB", GetName(playerid), GetName(targetid), pInfo[targetid][pWarn]);
					SAMToAll(COLOR_RED, string);
					LeaveFractionPlayer(targetid);
					format(string, sizeof(string), "Администратор %s выдал предупреждение игроку %s [%i/3]. Причина: DB", GetName(playerid), GetName(targetid), pInfo[targetid][pWarn]);
					WriteLog("WarnLog",string);
					mysql_query_string[0] = EOS;
					format(mysql_query_string, 200, "UPDATE "T_ADMIN" SET warned = %i, warned_reason = 'DB' WHERE admid = %i LIMIT 1", AdminInfo[playerid][admWarned], AdminInfo[playerid][admWarnedReason], AdminInfo[playerid][admID]);
					mysql_tquery(dbHandle, mysql_query_string, "", "");
					DeletePVar(playerid, "Players");
					Kick(targetid);
				}
			    case 6: // ПДД
			    {
			        if(pInfo[targetid][pJail] == 4) return SCM(playerid, COLOR_GREY, "Игрок уже находиться в деморгане!");
					{
						ResetPlayerWeaponsEx(targetid);
						pInfo[targetid][pJailTime] = 5*600;
						if(pCuff[targetid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[targetid][pCuffer];
							SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(targetid, 0);
							pCuff[targetid][pCuffer] = pCuff[targetid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 50 минут. Причина: ПДД", GetName(playerid), GetName(targetid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(targetid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(targetid, -90.0000);
						SetPlayerInterior(targetid, 1);
						SetPlayerVirtualWorld(targetid, 1);
						SetCameraBehindPlayer(targetid);
					    SetVehicleToRespawn(GetPlayerVehicleID(targetid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[targetid][pJailTime]);
						GameTextForPlayer(targetid, stringer, 3000, 3);
						pInfo[targetid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[targetid][pJail], pInfo[targetid][pJailTime], pInfo[targetid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 7: // Флуд в /ad
			    {
			    	if(pInfo[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, "Игрок уже имеет бан чата!");
			    	{
						pInfo[playerid][pMuted] = 4*600;
	     				format(stringer, sizeof(stringer), "Администратор %s выдал игроку %s бан чата на 40 минут. Причина: Флуд в /ad", pInfo[playerid][pName], pInfo[playerid][pName]);
						SCMTA(COLOR_RED, stringer);
						DeletePVar(playerid, "Players");
				 	}
			    }
			    case 8: // Дебош
			    {
			        if(pInfo[playerid][pJail] == 4) return SCM(playerid, COLOR_GREY, "Игрок уже находиться в деморгане!");
					{
						ResetPlayerWeaponsEx(playerid);
						pInfo[playerid][pJailTime] = 1*300;
						if(pCuff[playerid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[playerid][pCuffer];
							SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(playerid, 0);
							pCuff[playerid][pCuffer] = pCuff[playerid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 15 минут. Причина: Дебош", GetName(playerid), GetName(playerid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(playerid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(playerid, -90.0000);
						SetPlayerInterior(playerid, 1);
						SetPlayerVirtualWorld(playerid, 1);
						SetCameraBehindPlayer(playerid);
					    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[playerid][pJailTime]);
						GameTextForPlayer(playerid, stringer, 3000, 3);
						pInfo[playerid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[playerid][pJail], pInfo[playerid][pJailTime], pInfo[playerid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 9: // Caps Lock
			    {
			        if(pInfo[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, "Игрок уже имеет бан чата!");
			        {
						pInfo[playerid][pMuted] = 1*600;
	     				format(stringer, sizeof(stringer), "Администратор %s выдал игроку %s бан чата на 10 минут. Причина: Caps Lock", pInfo[playerid][pName], pInfo[playerid][pName]);
						SCMTA(COLOR_RED, stringer);
						DeletePVar(playerid, "Players");
					}
			    }
			    case 10: // SK
			    {
			        if(pInfo[playerid][pJail] == 4) return SCM(playerid, COLOR_GREY, "Игрок уже находиться в деморгане!");
					{
						ResetPlayerWeaponsEx(playerid);
						pInfo[playerid][pJailTime] = 6*600;
						if(pCuff[playerid][pCuffer] != INVALID_PLAYER_ID)
						{
							new cuffer = pCuff[playerid][pCuffer];
							SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(playerid, 0);
							pCuff[playerid][pCuffer] = pCuff[playerid][pCuffee] = pCuff[cuffer][pCuffee] = pCuff[cuffer][pCuffer] = INVALID_PLAYER_ID;
						}
						format(stringer, sizeof(stringer), "Администратор %s посадил %s в деморган на 60 минут. Причина: SK", GetName(playerid), GetName(playerid));
						SCMTA(COLOR_RED, stringer);
						SetPlayerPos(playerid, 221.7563, 1650.8401, 1001.0881);
						SetPlayerFacingAngle(playerid, -90.0000);
						SetPlayerInterior(playerid, 1);
						SetPlayerVirtualWorld(playerid, 1);
						SetCameraBehindPlayer(playerid);
					    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
						format(stringer, sizeof(stringer), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%d", pInfo[playerid][pJailTime]);
						GameTextForPlayer(playerid, stringer, 3000, 3);
						pInfo[playerid][pJail] = 4;
						mysql_query_string[0] = EOS;
						format(mysql_query_string, 200, "UPDATE "T_ACCOUNTS" SET jail = %i, jailtime = %i WHERE id = %i", pInfo[playerid][pJail], pInfo[playerid][pJailTime], pInfo[playerid][pID]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						DeletePVar(playerid, "Players");
					}
			    }
			    case 11: // MG
			    {
			        if(pInfo[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, "Игрок уже имеет бан чата!");
					{
	     				pInfo[playerid][pMuted] = 3*600;
	     				format(stringer, sizeof(stringer), "Администратор %s выдал игроку %s бан чата на 30 минут. Причина: MG", pInfo[playerid][pName], pInfo[playerid][pName]);
						SCMTA(COLOR_RED, stringer);
						DeletePVar(playerid, "Players");
					}
			    }
			    case 12: // TK
			    {
     				pInfo[playerid][pTimeToLastWarn] = gettime();
					pInfo[playerid][pWarn]++;
  					new string[144];
					if(pInfo[playerid][pWarn] > 2)
					{
						format(string, sizeof(string), "Администратор %s выдал предупреждение игроку %s [%i/3]. Причина: TK. Акк заблок. на 10 дней", GetName(playerid), GetName(playerid), pInfo[playerid][pWarn]);
				        mysql_query_string[0] = EOS;
						format(mysql_query_string, sizeof(mysql_query_string), "INSERT INTO "T_BANS" (name,whobanned,ip,bandate,time,unbandate,reason) VALUES ('%s','%s','%s',CURDATE(),10,CURDATE() + INTERVAL 10 DAY,'%s')", GetName(playerid), GetName(playerid), pInfo[playerid][pIP]);
						mysql_tquery(dbHandle, mysql_query_string, "", "");
						pInfo[playerid][pWarn] = 0;
					}
					else format(string, sizeof(string), "Администратор %s выдал предупреждение игроку %s [%i/3]. Причина: TK", GetName(playerid), GetName(playerid), pInfo[playerid][pWarn]);
					SAMToAll(COLOR_RED, string, playerid);
					LeaveFractionPlayer(playerid);
					format(string, sizeof(string), "Администратор %s выдал предупреждение игроку %s [%i/3]. Причина: TK", GetName(playerid), GetName(playerid), pInfo[playerid][pWarn]);
					WriteLog("WarnLog",string);
					mysql_query_string[0] = EOS;
					format(mysql_query_string, 200, "UPDATE "T_ADMIN" SET warned = %i, warned_reason = '%s' WHERE admid = %i LIMIT 1", AdminInfo[playerid][admWarned], AdminInfo[playerid][admWarnedReason], AdminInfo[playerid][admID]);
					mysql_tquery(dbHandle, mysql_query_string, "", "");
					DeletePVar(playerid, "Players");
					Kick(playerid);
			    }
			}
	    }

 

 

Суть такова что при использовании данной команды на другом человеке при онлайне +3 человека, наказание идет не на того которого хотел наказать а совсем на другого. Помогите как исправить?

Share this post


Link to post
Share on other sites
Спойлер

CMD:players(playerid, params[])
{
	if(pInfo[playerid][pAdmin] >= 6)
	{
		if(!gAdminLogged[playerid]) return SCM(playerid, COLOR_GREY, YouAreNotLoggedInAsAdmin);
		else if(sscanf(params, "d", params[0])) return SCM(playerid, COLOR_WHITE, "Введите: /players [id игрока]");
		else if(params[0] == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
		else if(!gPlayerLogged[params[0]]) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
		SetPVarInt(playerid, "Players", params[0]);
		format(stringer, sizeof(stringer),"{FFFFFF}Тип наказания игрока: %s {00CC00}[ID: %d]", pInfo[params[0]][pName], params[0]);
		SPD(playerid, dPlayers, DIALOG_STYLE_LIST, stringer, "{FFFFFF}\
		NonRP\n\
		NonRP Угон\n\
		NonRP Drive\n\
		NonRP Nick\n\
		DM\n\
		DB\n\
		ПДД\n\
		Флуд в /ad\n\
		Дебош\n\
		Caps Lock\n\
		SK\n\
		MG\n\
		TK", "Ок", "Закрыть");
	}
	return 1;
}

 

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • sweet
      By sweet
      Хелп,при компиле выдает ошибку C:\Users\PC\Desktop\pawno\pawno\include\objects.inc(1104) : error 029: invalid expression, assumed zero
      Сама строка в которой ошибка:    {-2032.7073,-73.8643,35.2484, -2006.3911,-52.6238,35.2704},
      Закройте тему,проблема решилась сама по себе