1 post in this topic

Всем привет! Выкладываю команду для RP отыгровок на сервере. 

Для тех, кто в танке поясню: данная команда позволяет писать от третьего лица с причастным оборотом (?) на DC_CMD / ZCMD / Pawn.CMD: 

Спойлер

CMD:todo(playerid, params[])
{
	new data_temp_text_todo[128], data_temp_string[54], data_player_name[24];
        GetPlayerName(playerid, data_player_name, 24);
	if(sscanf(params, "s[128]", data_temp_text_todo)) return SCM(playerid, 0xB4B5B7FF, "Используйте /todo [Текст*Действие]");
	if(strfind(data_temp_text_todo, "*") == -1) return SCM(playerid, 0xB4B5B7FF, "Используйте /todo [Текст*Действие]");
	format(data_temp_string, sizeof(data_temp_string), "', {DD90FF}- сказал(а) %s, ", data_player_name);
	new data_of_token = strfind(data_temp_text_todo, "*");
	strdel(data_temp_text_todo, strfind(data_temp_text_todo, "*"), strfind(data_temp_text_todo, "*")+1);
	strins(data_temp_text_todo, data_temp_string, data_of_token);
	strins(data_temp_text_todo, "'", 0);
	SetPlayerChatBubble(playerid, data_temp_text_todo, 0x6495EDFF, 20.0, 10000);
	ProxDetector(20.0, playerid, data_temp_text_todo, 0xE6E6E6E6,0xC8C8C8C8,0xAAAAAAAA,0x8C8C8C8C,0x6E6E6E6E);
	return 1;
}

 

Спойлер

// кинуть в конец мода: 
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		for(new i = 0; i <= GetPlayerPoolSize(); i++)
		{
				if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
			{
				GetPlayerPos(i, posx, posy, posz);
				tempposx = (oldposx -posx);
				tempposy = (oldposy -posy);
				tempposz = (oldposz -posz);
				if(((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
				{
					SendClientMessage(i, col1, string);
				}
				else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
				{
					SendClientMessage(i, col2, string);
				}
				else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
				{
					SendClientMessage(i, col3, string);
				}
				else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
				{
					SendClientMessage(i, col4, string);
				}
				else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
				{
					SendClientMessage(i, col5, string);
				}
			}
		}
	}
	return true;
}

 

Вырезано с StageRp

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

    • YaroslavGTA
      By YaroslavGTA
      Смотрите, я прикрепил к автомобилю объект AttachObjectToVehicle, хотел бы, чтобы объект удалялся на команду через функцию DestroyObject, а именно, чтобы можно было удалить через проверку, но у меня выходят варнинги. 
      Выдает в public OnObjectMoved(objectid) error 017: undefined symbol "blue" error 017: undefined symbol "blueblue" error 017: undefined symbol "redblue в CMD добавлены  new blue new blueblue new redblue