3 posts in this topic

Эти команды в особенности могут пригодиться при проведении мероприятий и пр.

Спойлер

if(strcmp(cmd,"/atw",true)==0)
    {
        if(PlayerInfo[playerid][pAdmin] >=3)
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"Введите: /atw [радиус]");
            new Float:pos = floatstr(tmp),Float:player_x,Float:player_y,Float:player_z;
            for(new players=0; players < MAX_PLAYERS; players++)
            {
                    GetPlayerPos(players,player_x,player_y,player_z);
                    if(IsPlayerInRangeOfPoint(playerid,pos,player_x,player_y,player_z))
                    {
                        ResetPlayerWeapons(players);
                        SendClientMessage(players, COLOR_YELLOW,"Администратор изъял Ваше оружие.");
                    }
                }
                format(string, sizeof(string), "Вы изъяли оружие у игроков в установленном радиусе.");
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        return 1;
    } 

 

Спойлер

if(strcmp(cmd,"/ahp",true)==0)
    {
        if(PlayerInfo[playerid][pAdmin] >=3)
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"{}Введите: /ahp [радиус]");
            new Float:pos = floatstr(tmp),Float:player_x,Float:player_y,Float:player_z;
            for(new players=0; players < MAX_PLAYERS; players++)
            {
                    GetPlayerPos(players,player_x,player_y,player_z);
                    if(IsPlayerInRangeOfPoint(playerid,pos,player_x,player_y,player_z))
                    {
                        SetPlayerHealth(players, 100.0);
                        SendClientMessage(players, COLOR_YELLOW,"Администратор установил Вам здоровье(100hp)");
                    }
                }
                format(string, sizeof(string), "Вы установили полное здоровье игрокам в установленном радиусе.");
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        return 1;
    }

 

Спойлер

if(strcmp(cmd,"/agg",true)==0)
    {
        if(PlayerInfo[playerid][pAdmin] >=3)
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"Используйте: /agg [радиус]");
            new Float:pos = floatstr(tmp),Float:player_x,Float:player_y,Float:player_z;
            for(new players=0; players < MAX_PLAYERS; players++)
            {
                    GetPlayerPos(players,player_x,player_y,player_z);
                    if(IsPlayerInRangeOfPoint(playerid,pos,player_x,player_y,player_z))
                    {
                ServerGivePlayerWeapons(players, 24, 999);
                ServerGivePlayerWeapons(players, 25, 999);
                ServerGivePlayerWeapons(players, 29, 999);
                ServerGivePlayerWeapons(players, 31, 999);
                        SendClientMessage(players, COLOR_YELLOW,"Администратор выдал Вам оружие.");
                    }
                }
                format(string, sizeof(string), "Вы раздали оружие игрокам в установленном радиусе.");
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        return 1;
    } 

 

 

Share this post


Link to post
Share on other sites

Можешь сделать для DC_CMD

Share this post


Link to post
Share on other sites

@Banana,

 

Спойлер

CMD:atw(playerid, params[]) {
	if (PlayerInfo[playerid][pAdmin] < 3) return 1;
	
	new Float:radius;
	if (sscanf(params, "f", radius)) return  SendClientMessage(playerid,COLOR_WHITE,"Введите: /atw [радиус]");
	
	new Float:player_x, Float:player_y, Float:player_z;
	for(new players = 0; players < MAX_PLAYERS; players++)
	{
		GetPlayerPos(players, player_x, player_y, player_z);
		if(IsPlayerInRangeOfPoint(playerid, radius, player_x, player_y, player_z))
		{
			ResetPlayerWeapons(players);
			SendClientMessage(players, COLOR_YELLOW,"Администратор изъял Ваше оружие.");
		}
	}
	
	format(string, sizeof(string), "Вы изъяли оружие у игроков в установленном радиусе.");
	SendClientMessage(playerid, COLOR_YELLOW, string);
	return 1;
}

 

 

Спойлер

CMD:ahp(playerid, params[]) {
	if (PlayerInfo[playerid][pAdmin] < 3) return 1;
	
	new Float:radius;
	if (sscanf(params, "f", radius)) return SendClientMessage(playerid,COLOR_WHITE,"{}Введите: /ahp [радиус]");
	
	new Float:player_x, Float:player_y, Float:player_z;
	for(new players = 0; players < MAX_PLAYERS; players++)
	{
		GetPlayerPos(players, player_x, player_y, player_z);
		if(IsPlayerInRangeOfPoint(playerid, radius, player_x, player_y, player_z))
		{
			SetPlayerHealth(players, 100.0);
			SendClientMessage(players, COLOR_YELLOW,"Администратор установил Вам здоровье(100hp)");
		}
	}
	
	format(string, sizeof(string), "Вы установили полное здоровье игрокам в установленном радиусе.");
	SendClientMessage(playerid, COLOR_YELLOW, string);
	return 1;
}

 

 

Спойлер

CMD:agg(playerid, params[]) {
	if (PlayerInfo[playerid][pAdmin] < 3) return 1;
	
	new Float:radius;
	if (sscanf(params, "f", radius)) return SendClientMessage(playerid,COLOR_WHITE,"Используйте: /agg [радиус]");
	
	for(new players = 0; players < MAX_PLAYERS; players++)
	{
		GetPlayerPos(players, player_x, player_y, player_z);
		if(IsPlayerInRangeOfPoint(playerid, radius, player_x, player_y, player_z))
		{
			ServerGivePlayerWeapons(players, 24, 999);
			ServerGivePlayerWeapons(players, 25, 999);
			ServerGivePlayerWeapons(players, 29, 999);
			ServerGivePlayerWeapons(players, 31, 999);
			SendClientMessage(players, COLOR_YELLOW,"Администратор выдал Вам оружие.");
		}
	}
	format(string, sizeof(string), "Вы раздали оружие игрокам в установленном радиусе.");
	SendClientMessage(playerid, COLOR_YELLOW, string);
	return 1;
}

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Dworkin
      By Dworkin
      Привет. Мне тяжело дается понимание строк в pawn из за не динамических массивов.
      #include enum pInfo { pRangName[25] } new players[MAX_PLAYERS][pInfo]; new string[20]; main() { format(string, sizeof(string), "Салага"); printf(string); players[0][pRangName] = string; } выдает ошибку "error 047: array sizes do not match, or destination array is too small" на строку "players[0][pRangName] = string;"
      Я понимаю что в ошибке говорится что размер не совпадает, но не могу понять как это сделать в павне