Если Вы нашли ответ на вопрос, пожалуйста, пометьте необходимый ответ лучшим (галочка сбоку от сообщения) и поблагодарите автора этого ответа поднятием репутации (плюс в нижней правой части сообщения). Спасибо.
Подробнее:
FAQ по форуму
Как пометить ответ лучшим

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



20 posts in this topic

Помогите не работает команда /invite

Команда:

CMD:invite(playerid, params[])
{
	if(!IsAbleToInvite(playerid)) return SCM(playerid, COLOR_GREY, YouCanNot);
	new targetid;
	if(sscanf(params, "u", targetid)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Ïîäñêàçêà ] {ffffff}Ââåäèòå: /invite [id èãðîêà]");
	else if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
	else if(PlayerLogged[targetid] == false) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
	else if(PI[targetid][pLeader] > 0) return SCM(playerid, COLOR_GREY, "Èãðîê ëèäåð äðóãîé îðãàíèçàöèè!");
	else if(PI[targetid][pAdmin] > 0) return SCM(playerid, COLOR_GREY, "Àäìèíèñòðàòîðó çàïðåùåíî íàõîäèòñÿ âî ôðàêöèè!");
	else if(PI[targetid][pMember] > 0) return SCM(playerid, COLOR_GREY, "Èãðîê íàõîäèòüñÿ â äðóãîé îðãàíèçàöèè!");
	else if(PI[targetid][pWarn] > 0) return SCM(playerid, COLOR_GREY, "Ó èãðîêà ïðåäóïðåæäåíèå!");
	else if(IsPlayerInAnyVehicle(targetid)) return SCM(playerid, COLOR_GREY, "Èãðîê íå äîëæåí íàõîäèòüñÿ â òðàíñïîðòå!");
	else if(!IsPlayerInRangeOfPlayer(8.0, playerid, targetid)) return SCM(playerid, COLOR_GREY, "Èãðîê ñëèøêîì äàëåêî!");
	else if(PI[playerid][pMember] != TEAM_ARMIYA && PI[targetid][pLevel] < 3) return SCM(playerid, COLOR_GREY, "Ó èãðîêà íåò 3 óðîâíÿ!");
	else if(IsACop(playerid) && !PI[targetid][pVoennik]) return SCM(playerid, COLOR_GREY, "Ó èãðîêà íåò âîåííîãî áèëåòà!");
	
	new string[256];
	SendMes(playerid,COLOR_BLUE,"Âû ïðåäëîæèëè %s ïðèñîåäèíèòüñÿ â âàøó îðãàíèçàöèþ",GetName(targetid));
	format(string,sizeof(string),"%s %s ïðåäëàãàåò âàì ïðèñîåäèíèòüñÿ ê \"%s\"\n\nÂû ñîãëàñíû?",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), Fraction_Name[PI[playerid][pMember]]);
	ShowPlayerDialog(targetid, D_INVITEFRAC, 0, "{ffa500}Âñòóïëåíèå âî ôðàêöèþ",string,"Äà","Íåò");
	SetPVarInt(targetid, "offerfractionid", PI[playerid][pMember]);
	SetPVarInt(targetid, "offerplayer", playerid);
	SetPVarInt(playerid, "actplayerid", params[0]);
			
	return 1;
}

Edited by stibs
Причина: Спойлер

Share this post


Link to post
Share on other sites

Во-первых, копируйте на русской раскладке из pawno, 

Во-вторых, что именно не работает ? Вообще ничего не происходит? 

Share this post


Link to post
Share on other sites

Вот это мне на русском языке предоставьте:

new string[256];
SendMes(playerid,COLOR_BLUE,"Âû ïðåäëîæèëè %s ïðèñîåäèíèòüñÿ â âàøó îðãàíèçàöèþ",GetName(targetid));
format(string,sizeof(string),"%s %s ïðåäëàãàåò âàì ïðèñîåäèíèòüñÿ ê \"%s\"\n\nÂû ñîãëàñíû?",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), Fraction_Name[PI[playerid][pMember]]);
ShowPlayerDialog(targetid, D_INVITEFRAC, 0, "{ffa500}Âñòóïëåíèå âî ôðàêöèþ",string,"Äà","Íåò");
SetPVarInt(targetid, "offerfractionid", PI[playerid][pMember]);
SetPVarInt(targetid, "offerplayer", playerid);
SetPVarInt(playerid, "actplayerid", params[0]);

 

Share this post


Link to post
Share on other sites

@stibs 

	new string[256];
	SendMes(playerid,COLOR_BLUE,"Вы предложили %s присоединиться в вашу организацию",GetName(targetid));
	format(string,sizeof(string),"%s %s предлагает вам присоединиться к \"%s\"\n\nВы согласны?",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), Fraction_Name[PI[playerid][pMember]]);
	ShowPlayerDialog(targetid, D_INVITEFRAC, 0, "{ffa500}Вступление во фракцию",string,"Да","Нет");
	SetPVarInt(targetid, "offerfractionid", PI[playerid][pMember]);
	SetPVarInt(targetid, "offerplayer", playerid);
	SetPVarInt(playerid, "actplayerid", params[0]);

 

Share this post


Link to post
Share on other sites

Массив FractionName скиньте. И, да, оно только так выводит в чат или еще и принимает во фракцию "Нет"?

Share this post


Link to post
Share on other sites

@Daniil Roslyakov Прошу прощения, Fraction_Name. И, да, в статистике у игрока отображается фракция или написано "Отсутствует"? 

Share this post


Link to post
Share on other sites

@stibs 

static const stock Fraction_Name[MAX_FRACTIONS][32] = {
	"Нет", // 0
	"Правительство", // 1
	"Полиция", // 2
	"ДПС", // 3
	"ФСБ", // 4
	"Больница", // 5
	"Автошкола", // 6
	"Итальянская Мафия",// 7
	"Армия", // 8
	"ОПГ 'Ореховское'", // 9
	"ОПГ 'Солнцевское'", // 10
	"Русская Мафия",// 11
	"СМИ" // 12
};
	if(IsANews(playerid) && Ether[playerid] == true)
	{
		format(string, sizeof(string), "[%s] %s: %s", Fraction_Name[PI[playerid][pMember]], GetName(playerid), text);
		SendNMes(TEAM_BLUE_COLOR, string);
		return 0;
	}
	if(EtherLive[playerid] == true)
	{
	    new enterfrac = GetPVarInt(playerid, "Etherfrac");
		format(string, sizeof(string), "[LIVE] [%s] %s: %s", Fraction_Name[enterfrac], GetName(playerid), text);
		if(enterfrac == TEAM_SMI) SendNMes(TEAM_BLUE_COLOR, string);
		return 0;
	}
		case D_INVITESKIN:
	    {
	        if(!response) return 1;
	        new actplayerid = GetPVarInt(playerid, "actplayerid");
			new fractionid = GetPVarInt(actplayerid, "offerfractionid");
			new skinid = Fraction_Skin[fractionid][listitem];
			PI[actplayerid][pMember] = fractionid;
			PI[actplayerid][pRank] = 1;
			PI[actplayerid][pMemberSkin] = skinid;
			SetPlayerSkin(actplayerid, skinid);
			PI[actplayerid][pJob] = 0;
			SetPlayerColorEx(actplayerid, TeamColors[GetTeamID(actplayerid)]);
			ResetPlayerWeaponsAC(actplayerid);
			new string[256];
			format(string, sizeof(string), "[F] %s %s[%d] принял в организацию %s[%d]",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]),PI[playerid][pName],playerid,PI[actplayerid][pName],actplayerid);
		    SendFMes(PI[playerid][pMember], COLOR_YELLOW2, string);
		    SendMes(actplayerid, COLOR_BLUE, "Вы присоединились к организации \"%s\"", Fraction_Name[fractionid]);
			SendMes(playerid, COLOR_BLUE, "%s принял предложение присоединиться к \"%s\"", GetName(actplayerid), Fraction_Name[fractionid]);
		}
		case D_LEADERSKIN:
	    {
			if(!response)
			{
				DeletePVar(playerid, "actplayerid");
				DeletePVar(playerid, "actfraction");
				return 1;
			}
			new actplayerid = GetPVarInt(playerid, "actplayerid");
	        new fractionid = GetPVarInt(playerid, "actfraction");
	        new skinid = Fraction_Skin[fractionid][listitem];
			if(!IsPlayerConnected(actplayerid)) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
			else if(!PlayerLogged[actplayerid]) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
			switch(fractionid)
			{
			    case TEAM_ARMIYA: PI[actplayerid][pRank] = 12;
			    case TEAM_FBI: PI[actplayerid][pRank] = 16;
			    case TEAM_POLICIA,TEAM_DPS,TEAM_MERIA,TEAM_BOLNICA,TEAM_ITALYM,TEAM_RM,TEAM_OPG1,TEAM_OPG2,TEAM_SMI: PI[actplayerid][pRank] = 10;
			    case TEAM_AUTOSCHOOL: PI[actplayerid][pRank] = 8;
			}
			PI[actplayerid][pLeader] = PI[actplayerid][pMember] = fractionid;
			PI[actplayerid][pJob] = 0;
			PI[actplayerid][pMemberSkin] = skinid;
			SetPlayerSkin(actplayerid, PI[actplayerid][pMemberSkin]);
			new string[128];
			format(string, sizeof(string), "Вы назначили %s лидером организации: %s", GetName(actplayerid), Fraction_Name[fractionid]);
			SCM(playerid, COLOR_LIME, string);
			format(string, sizeof(string), "Администратор %s назначил Вас лидером организации: %s", GetName(playerid), Fraction_Name[fractionid]);
			SCM(actplayerid, COLOR_BLUE, string);
			format(string, sizeof(string), "[A] %s назначил %s лидером организации \"%s\"", GetName(playerid), GetName(actplayerid), Fraction_Name[fractionid]);
			SendAdminMessage(COLOR_GREY, string);
			SendLog("SetLeader", string);
			ResetPlayerWeaponsAC(actplayerid);
			SetPlayerColorEx(actplayerid, TeamColors[GetTeamID(actplayerid)]);
			DeletePVar(playerid, "actplayerid");
			DeletePVar(playerid, "actfraction");
	    }
		case D_TEMPLEADER:
		{
			if(!response) return 1;
			new fractionid = listitem+1;
			switch(fractionid)
			{
			    case TEAM_ARMIYA: PI[playerid][pRank] = 12;
			    case TEAM_FBI: PI[playerid][pRank] = 16;
			    case TEAM_POLICIA,TEAM_DPS,TEAM_MERIA,TEAM_BOLNICA,TEAM_ITALYM,TEAM_RM,TEAM_OPG1,TEAM_OPG2,TEAM_SMI: PI[playerid][pRank] = 10;
			    case TEAM_AUTOSCHOOL: PI[playerid][pRank] = 8;
			}
			PI[playerid][pLeader] = PI[playerid][pTempLeader] = PI[playerid][pMember] = fractionid;
			PI[playerid][pJob] = 0;
			PI[playerid][pMemberSkin] = GetPlayerSkin(playerid);
			PI[playerid][pSpawnChange] = 2;
			new string[128];
		    format(string, sizeof(string), "Вы назначили себя времеменным лидером организации: %s", Fraction_Name[fractionid]);
			SCM(playerid, COLOR_LIME, string);
			format(string, sizeof(string), "[A] %s назначил себя времеменным лидером организации \"%s\"", GetName(playerid), Fraction_Name[fractionid]);
			SendAdminMessage(COLOR_GREY, string);
			SendLog("SetTempLeader", string);
			ResetPlayerWeaponsAC(playerid);
			SetPlayerColorEx(playerid, TeamColors[GetTeamID(playerid)]);
	    }
	case D_FRACMENU+11:
		{
		    if(!response) return SCM(playerid,COLOR_GREY,"Вы отказались от смены названия ранга"),DeletePVar(playerid,"RANGNUM"),DeletePVar(playerid,"NEWRANG");
		    new string[512],query[512],newrank[32];
		    new id = GetPVarInt(playerid,"RANGNUM"); GetPVarString(playerid,"NEWRANG",newrank,sizeof(newrank));
			DeletePVar(playerid,"NEWRANG"),DeletePVar(playerid,"RANGNUM");

		    f(string,"{FFFFFF}Вы успешно сменили название для ранга!\n\nСтарое звание ранга №%d %s\nНовое звание ранга №%d %s",id,Fraction_Rang(PI[playerid][pMember],id),id,newrank);
		    ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_MSGBOX, "{ffa500}Названия рангов",string, "Закрыть", "");

		    format(string, sizeof(string), "[A] Лидер %s[%i] организации %s(%d) поменял название ранга(%d) с %s на %s", GetName(playerid), playerid,Fraction_Name[PI[playerid][pMember]],PI[playerid][pMember],id,Fraction_Rang(PI[playerid][pMember],id),newrank);
			SendAdminMessage(COLOR_GREY, string);
			format(string, sizeof(string), "[F] Лидер %s[%i] поменял название ранга(%d) с %s на %s",GetName(playerid), playerid,id,Fraction_Rang(PI[playerid][pMember],id),newrank);
			SendFMes(PI[playerid][pMember], COLOR_YELLOW2, string);

			settext(RankInfo[PI[playerid][pMember]][id-1],newrank);

		    format(string,sizeof(string),"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s"
		    ,RankInfo[id][0],RankInfo[id][1],RankInfo[id][2],RankInfo[id][3],RankInfo[id][4],RankInfo[id][5],RankInfo[id][6],RankInfo[id][7]
			,RankInfo[id][8],RankInfo[id][9],RankInfo[id][10],RankInfo[id][11],RankInfo[id][12],RankInfo[id][13],RankInfo[id][14],RankInfo[id][15]);
			format(query, sizeof(query), "UPDATE "T_RANKS" SET `Ranks` = '%s' WHERE `FRACID` = '%d'",string,id);
			mysql_tquery(dbHandle, query, "", "");
		}
CMD:resetranks(playerid,params[])
{
    if(PI[playerid][pAdmin] < 7) return 1;
    if(sscanf(params, "i", params[0])) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /resetranks [id организации]");
    if(params[0] < 1 || params[0] > 12) return SCM(playerid,COLOR_GREY, "Используйте от 1 до 12");
    new string[512],query[512];
    
    for(new i2; i2 != MAX_RANGS; i2 ++) settext(RankInfo[params[0]][i2],Fraction_Rangs[params[0]][i2]);
    
    format(string,sizeof(string),"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s"
    ,RankInfo[params[0]][0],RankInfo[params[0]][1],RankInfo[params[0]][2],RankInfo[params[0]][3],RankInfo[params[0]][4],RankInfo[params[0]][5],RankInfo[params[0]][6],RankInfo[params[0]][7]
	,RankInfo[params[0]][8],RankInfo[params[0]][9],RankInfo[params[0]][10],RankInfo[params[0]][11],RankInfo[params[0]][12],RankInfo[params[0]][13],RankInfo[params[0]][14],RankInfo[params[0]][15]);
	format(query, sizeof(query), "UPDATE "T_RANKS" SET `Ranks` = '%s' WHERE `FRACID` = '%d'",string,params[0]);
	mysql_tquery(dbHandle, query, "", "");
	
	format(string, sizeof(string), "[A] %s[%i] вернул дефолтные названия рангов организации %s(%d)", GetName(playerid), playerid,Fraction_Name[params[0]],params[0]);
	SendAdminMessage(COLOR_GREY, string);
	SendLog("Adminlog",string);
	format(string, sizeof(string), "[F] Администратор %s[%d] вернул Вашей организации дефолтные названия рангов",GetName(playerid), playerid);
	SendFMes(params[0], COLOR_YELLOW2, string);
	return true;
}
CMD:setleader(playerid, params[])
{
    if(GetString(GetName(playerid), NAME_DEVELOPER_ONE) || GetString(GetName(playerid), NAME_DEVELOPER_TWO) || GetString(GetName(playerid), NAME_LEADERS_ONE) || GetString(GetName(playerid), NAME_LEADERS_TWO))
	{
		if(PI[playerid][pAdmin] < 1) return 1;
		else if(AdminLogged[playerid] == false) return SCM(playerid, COLOR_GREY, YouAreNotLoggedInAsAdmin);
		else if(sscanf(params, "u", params[0])) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /setleader [id игрока]");
		else if(!IsPlayerConnected(params[0])) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
		else if(PlayerLogged[params[0]] == false) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
		else if(IsPlayerInAnyVehicle(params[0])) return SCM(playerid, COLOR_GREY, "Игрок не должен находиться в транспорте!");
		else if((PI[params[0]][pAdmin] >= 1 && PI[params[0]][pAdmin] <= 7) && PI[playerid][pAdmin] != 8) return SCM(playerid, COLOR_GREY, "Администратора нельзя ставить на пост лидера!");
		else if(PI[params[0]][pLevel] < 3) return SCM(playerid, COLOR_GREY, "У игрока меньше чем 3 уровень!");
		else if(PI[params[0]][pTempLeader]) return SCM(playerid, COLOR_GREY, "Сначала снимите с себя права временного лидера!");
		if(PI[params[0]][pLeader])
		{
			LeaveFractionPlayer(params[0]);
			SendMes(playerid, COLOR_BLUE, "Вы сняли %s с должности лидера организации",GetName(params[0]));
			SendMes(params[0], COLOR_BLUE, "Администратор %s снял вас с должности лидера организации", GetName(playerid));
		}
		else
		{
			if(PI[params[0]][pLeader] > 0) return SCM(playerid, COLOR_GREY, "Игрок лидер другой организации!");
			else if(PI[params[0]][pMember] > 0) return SCM(playerid, COLOR_GREY, "Игрок находиться в другой организации!");
			new str[64], str2[712];
			for(new i = 1; i < MAX_FRACTIONS; i++)
			{
				format(str, sizeof(str), "№%i - %s\n", i, Fraction_Name[i]);
				strcat(str2, str);
			}
			SetPVarInt(playerid, "actplayerid", params[0]);
			ShowPlayerDialog(playerid, D_FRACMENU, 2, "{ffcc00}Организации", str2, "Принять", "Отмена");
		}
	}
	return 1;
}
CMD:templeader(playerid)
{
	if(PI[playerid][pAdmin] < 6) return 1;
	else if(AdminLogged[playerid] == false) return SCM(playerid, COLOR_GREY, YouAreNotLoggedInAsAdmin);
	if(PI[playerid][pTempLeader])
	{
		if(PI[playerid][pTempLeader] == 0) return SCM(playerid, COLOR_GREY, "Вы не являетесь временным лидером!");
		LeaveFractionPlayer(playerid);
		PI[playerid][pTempLeader] = 0;
		SCM(playerid, COLOR_BLUE, "Вы сняли себя с должности временного лидера организации");
	}
	else
	{
		new str[90], str2[600];
		for(new i = 1; i < MAX_FRACTIONS; i++)
		{
			format(str, sizeof(str), "№%i - %s\n", i, Fraction_Name[i]);
			strcat(str2, str);
		}
		ShowPlayerDialog(playerid, D_TEMPLEADER, 2, "{ffcc00}Организации", str2, "Принять", "Отмена");
	}
	return 1;
}
CMD:f(playerid, params[])
{
	if(!IsAGang(playerid) && !IsAMafia(playerid)) return SCM(playerid, COLOR_GREY, YouCanNot);
	if(PI[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, PlayerHaveMuteTime);
	else if(PI[playerid][pSetting][0] == 0) return SCM(playerid, COLOR_GREY, "Ваш чат организации отключен!");
	else if(isnull(params)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /f [текст]");
	else if(TextReset[playerid] > gettime() && GetString(OldMessage[playerid], params[0])) return SCM(playerid,COLOR_GREY,"Не флуди");
	else if(IsIpFound(params[0]) || CheckString(params[0])) return PlayerGetsChatBan(playerid, params[0]);
	new string[128], mesid[128];
	format(string, sizeof(string), "[F] %s %s: %s", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
	format(mesid, sizeof(mesid), "[F] %s %s[%d]: %s", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), playerid, params[0]);
	if(PI[playerid][pSetting][3] == 0) SendFMes(PI[playerid][pMember], 0x4682B4AA, string);
	else SendFMes(PI[playerid][pMember], 0x4682B4AA, mesid);
	SetString(OldMessage[playerid], params[0]);
	TextReset[playerid] = gettime()+3;
	#if DEBUG_STATUS == true
		printf("[F] [%s] %s %s: %s",Fraction_Name[PI[playerid][pMember]],Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]),GetName(playerid),params[0]);
	#endif
	return 1;
}

CMD:fn(playerid, params[])
{
	if(!IsAGang(playerid) && !IsAMafia(playerid)) return SCM(playerid, COLOR_GREY, YouCanNot);
	if(PI[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, PlayerHaveMuteTime);
	else if(PI[playerid][pSetting][0] == 0) return SCM(playerid, COLOR_GREY, "Ваш чат организации отключен!");
	else if(isnull(params)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /fn [текст]");
	else if(TextReset[playerid] > gettime() && GetString(OldMessage[playerid], params[0])) return SCM(playerid,COLOR_GREY,"Не флуди");
	else if(IsIpFound(params[0]) || CheckString(params[0])) return PlayerGetsChatBan(playerid, params[0]);
	new string[128], mesid[128];
	format(string, sizeof(string), "(( [F] %s %s: %s ))", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
	format(mesid, sizeof(mesid), "(( [F] %s %s[%d]: %s ))", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), playerid, params[0]);
	if(PI[playerid][pSetting][3] == 0) SendFMes(PI[playerid][pMember], 0x4682B4AA, string);
	else SendFMes(PI[playerid][pMember], 0x4682B4AA, mesid);
	SetString(OldMessage[playerid], params[0]);
	TextReset[playerid] = gettime()+3;
	#if DEBUG_STATUS == true
		printf("[F] [%s] %s %s: %s", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank), GetName(playerid), params[0]);
	#endif
	return 1;
}
CMD:r(playerid, params[])
{
	if(IsACop(playerid) || PI[playerid][pMember] == TEAM_ARMIYA || IsAMedic(playerid) || IsAMayor(playerid) || PI[playerid][pMember] == TEAM_AUTOSCHOOL || IsANews(playerid))
	{
		if(PI[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, PlayerHaveMuteTime);
		else if(PI[playerid][pSetting][0] == 0) return SCM(playerid, COLOR_GREY, "Ваш чат организации отключен!");
		else if(isnull(params)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /r [текст]");
		else if(TextReset[playerid] > gettime() && GetString(OldMessage[playerid], params[0])) return SCM(playerid,COLOR_GREY,"Не флуди");
		else if(IsIpFound(params[0]) || CheckString(params[0])) return PlayerGetsChatBan(playerid, params[0]);
		new string[128], mesid[128];
		format(string, sizeof(string), "[R] %s %s: %s", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
		format(mesid, sizeof(mesid), "[R] %s %s[%d]: %s", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), playerid, params[0]);
		if(PI[playerid][pSetting][3] == 0) SendFMes(PI[playerid][pMember], 0x5da130FF, string);
		else SendFMes(PI[playerid][pMember], 0x5da130FF, mesid);
		SetPlayerChatBubble(playerid,"сообщает в рацию",COLOR_PURPLE,30.0,10000);
		SetString(OldMessage[playerid], params[0]);
		TextReset[playerid] = gettime()+3;
		#if DEBUG_STATUS == true
			printf("[R] [%s] %s %s: %s", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
		#endif
	}
	else SCM(playerid, COLOR_GREY, YouCanNot);
	return 1;
}

CMD:rn(playerid, params[])
{
	if(IsACop(playerid) || PI[playerid][pMember] == TEAM_ARMIYA || IsAMedic(playerid) || IsAMayor(playerid) || PI[playerid][pMember] == TEAM_AUTOSCHOOL || IsANews(playerid))
	{
		if(PI[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, PlayerHaveMuteTime);
		else if(PI[playerid][pSetting][0] == 0) return SCM(playerid, COLOR_GREY, "Ваш чат организации отключен!");
		else if(isnull(params)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /rn [текст]");
		else if(TextReset[playerid] > gettime() && GetString(OldMessage[playerid], params[0])) return SCM(playerid,COLOR_GREY,"Не флуди");
		else if(IsIpFound(params[0]) || CheckString(params[0])) return PlayerGetsChatBan(playerid, params[0]);
		new string[128], mesid[128];
		format(string, sizeof(string), "(( [R] %s %s: %s ))", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
		format(mesid, sizeof(mesid), "(( [R] %s %s[%d]: %s ))", Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), playerid, params[0]);
		if(PI[playerid][pSetting][3] == 0) SendFMes(PI[playerid][pMember], 0x5da130FF, string);
		else SendFMes(PI[playerid][pMember], 0x5da130FF, mesid);
		SetPlayerChatBubble(playerid,"сообщает в рацию",COLOR_PURPLE,30.0,10000);
		SetString(OldMessage[playerid], params[0]);
		TextReset[playerid] = gettime()+3;
		#if DEBUG_STATUS == true
			printf("[R] [%s] %s %s: %s", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
		#endif
	}
	else SCM(playerid, COLOR_GREY, YouCanNot);
	return 1;
}

CMD:d(playerid, params[])
{
	if(IsACop(playerid) || PI[playerid][pMember] == TEAM_ARMIYA || IsAMedic(playerid) || IsAMayor(playerid) || PI[playerid][pMember] == TEAM_AUTOSCHOOL || IsANews(playerid))
	{
		if(PI[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, PlayerHaveMuteTime);
		else if(PI[playerid][pSetting][0] == 0) return SCM(playerid, COLOR_GREY, "Ваш чат организации отключен!");
		else if(GetPVarInt(playerid,"dep") > gettime()) return SCM(playerid, 0xFF7979AA, "Следующее сообщение вы сможете отправить через 15 секунд!");
		else if(isnull(params)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /d [текст]");
		else if(TextReset[playerid] > gettime() && GetString(OldMessage[playerid], params[0])) return SCM(playerid,COLOR_GREY,"Не флуди");
		else if(IsIpFound(params[0]) || CheckString(params[0])) return PlayerGetsChatBan(playerid, params[0]);
		new string[128], mesid[128];
		format(string, sizeof(string), "[D] [%s] %s %s: %s", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
		format(mesid, sizeof(mesid), "[D] [%s] %s %s[%d]: %s", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), playerid, params[0]);
		if(PI[playerid][pSetting][3] == 0) SendDMes(0x007FFFFF, string);
		else SendDMes(0x007FFFFF, mesid);
		SetPlayerChatBubble(playerid,"сообщает в депортамент",COLOR_PURPLE,30.0,10000);
		SetPVarInt(playerid,"dep",gettime() + 15);
		#if DEBUG_STATUS == true
			printf("[D] [%s] %s %s: %s", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
        #endif
	}
	else SCM(playerid, COLOR_GREY, YouCanNot);
	return 1;
}

CMD:dn(playerid, params[])
{
	if(IsACop(playerid) || PI[playerid][pMember] == TEAM_ARMIYA || IsAMedic(playerid) || IsAMayor(playerid) || PI[playerid][pMember] == TEAM_AUTOSCHOOL || IsANews(playerid))
	{
		if(PI[playerid][pMuted] > 0) return SCM(playerid, COLOR_GREY, PlayerHaveMuteTime);
		else if(PI[playerid][pSetting][0] == 0) return SCM(playerid, COLOR_GREY, "Ваш чат организации отключен!");
		else if(GetPVarInt(playerid,"dep") > gettime()) return SCM(playerid, 0xFF7979AA, "Следующее сообщение вы сможете отправить через 15 секунд!");
		else if(isnull(params)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /dn [текст]");
		else if(TextReset[playerid] > gettime() && GetString(OldMessage[playerid], params[0])) return SCM(playerid,COLOR_GREY,"Не флуди");
		else if(IsIpFound(params[0]) || CheckString(params[0])) return PlayerGetsChatBan(playerid, params[0]);
		new string[128], mesid[128];
		format(string, sizeof(string), "(( [D] [%s] %s %s: %s ))", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
		format(mesid, sizeof(mesid), "(( [D] [%s] %s %s[%d]: %s ))", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), playerid, params[0]);
		if(PI[playerid][pSetting][3] == 0) SendDMes(0x007FFFFF, string);
		else SendDMes(0x007FFFFF, mesid);
		SetPVarInt(playerid,"dep",gettime() + 15);
		#if DEBUG_STATUS == true
			printf("(( [D] [%s] %s %s: %s ))", Fraction_Name[PI[playerid][pMember]], Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), params[0]);
        #endif
	}
	else SCM(playerid, COLOR_GREY, YouCanNot);
	return 1;
}
CMD:invite(playerid, params[])
{
	if(!IsAbleToInvite(playerid)) return SCM(playerid, COLOR_GREY, YouCanNot);
	new targetid;
	if(sscanf(params, "u", targetid)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /invite [id игрока]");
	else if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
	else if(PlayerLogged[targetid] == false) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
	else if(PI[targetid][pLeader] > 0) return SCM(playerid, COLOR_GREY, "Игрок лидер другой организации!");
	else if(PI[targetid][pAdmin] > 0) return SCM(playerid, COLOR_GREY, "Администратору запрещено находится во фракции!");
	else if(PI[targetid][pMember] > 0) return SCM(playerid, COLOR_GREY, "Игрок находиться в другой организации!");
	else if(PI[targetid][pWarn] > 0) return SCM(playerid, COLOR_GREY, "У игрока предупреждение!");
	else if(IsPlayerInAnyVehicle(targetid)) return SCM(playerid, COLOR_GREY, "Игрок не должен находиться в транспорте!");
	else if(!IsPlayerInRangeOfPlayer(8.0, playerid, targetid)) return SCM(playerid, COLOR_GREY, "Игрок слишком далеко!");
	else if(PI[playerid][pMember] != TEAM_ARMIYA && PI[targetid][pLevel] < 3) return SCM(playerid, COLOR_GREY, "У игрока нет 3 уровня!");
	else if(IsACop(playerid) && !PI[targetid][pVoennik]) return SCM(playerid, COLOR_GREY, "У игрока нет военного билета!");
	
	new string[256];
	SendMes(playerid,COLOR_BLUE,"Вы предложили %s присоединиться в вашу организацию",GetName(targetid));
	format(string,sizeof(string),"%s %s предлагает вам присоединиться к \"%s\"\n\nВы согласны?",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), Fraction_Name[PI[playerid][pMember]]);
	ShowPlayerDialog(targetid, D_INVITEFRAC, 0, "{ffa500}Вступление во фракцию",string,"Да","Нет");
	SetPVarInt(targetid, "offerfractionid", PI[playerid][pMember]);
	SetPVarInt(targetid, "offerplayer", playerid);
	SetPVarInt(playerid, "actplayerid", params[0]);
			
	return 1;
}

Edited by stibs
Причина: спойлер

Share this post


Link to post
Share on other sites

В конец команды invite добавьте:

printf("id member = %d", PI[playerid][pMember]);

Потом используйте команду и выложите логи.

Share this post


Link to post
Share on other sites

@stibs 

Спойлер

[18:08:36] [MySQL]: Подключение к базе данных прошло успешно
[18:08:36] Number of vehicle models: 10
[18:08:36] [Загружено орг/раб. автомобилей]: <135>. Потрачено: <3 ms>.
[18:08:36] [Загружено рангов для фракций]: <12>. Потрачено: <0 ms>.
[18:08:36] [Загружено бизнесов]: <3>. Потрачено: <0 ms>.
[18:08:36] [Загружено домов]: <143>. Потрачено: <7 ms>.
[18:08:36] [Загружены склады мафий]: Потрачено: <0 ms>.
[18:08:36] [Загружены склады ОПГ]: Потрачено: <0 ms>.
[18:08:36] [Загружено банкоматов]: <0>. Потрачено: <0 ms>.
[18:08:36] [Загружено остальное]: Потрачено: <0 ms>.
[18:08:36] [Загружено радаров]: <1>. Потрачено: <0 ms>.
[18:08:36] [System Hotels]: 50 hotels successfully loaded
[18:09:01] Incoming connection: 217.118.91.42:5735
[18:09:02] [join] Andrey_Buzak has joined the server (0:217.118.91.42)
[18:09:05] Incoming connection: 89.145.154.128:60726
[18:09:06] [join] Jaliba_Baron has joined the server (1:89.145.154.128)
[18:10:55] [chat] [Jaliba_Baron]: поможешь
[18:10:59] [chat] [Andrey_Buzak]: да
[18:11:00] [chat] [Jaliba_Baron]: дам доната
[18:11:17] [chat] [Jaliba_Baron]: щя дам донат купи военный билет снач
[18:11:22] [chat] [Andrey_Buzak]: ок
[18:11:30] [chat] [Andrey_Buzak]: всё
[18:11:31] id member = 3
[18:11:37] [chat] [Jaliba_Baron]: Так
[18:11:39] [chat] [Jaliba_Baron]: Все спс
[18:11:48] [chat] [Andrey_Buzak]: всё
[18:12:05] [chat] [Andrey_Buzak]: спасибо

 

 

Edited by stibs
Причина: спойлер

Share this post


Link to post
Share on other sites

Странно, однако, в команде и в диалоге ошибок никаких нет. 
Замените свою команду этой и попробуйте еще раз. И опять выложите логи. 

Спойлер

CMD:invite(playerid, params[])
{
	if(!IsAbleToInvite(playerid)) return SCM(playerid, COLOR_GREY, YouCanNot);
	new targetid;
	if(sscanf(params, "u", targetid)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /invite [id игрока]");
	else if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
	else if(PlayerLogged[targetid] == false) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
	else if(PI[targetid][pLeader] > 0) return SCM(playerid, COLOR_GREY, "Игрок лидер другой организации!");
	else if(PI[targetid][pAdmin] > 0) return SCM(playerid, COLOR_GREY, "Администратору запрещено находится во фракции!");
	else if(PI[targetid][pMember] > 0) return SCM(playerid, COLOR_GREY, "Игрок находиться в другой организации!");
	else if(PI[targetid][pWarn] > 0) return SCM(playerid, COLOR_GREY, "У игрока предупреждение!");
	else if(IsPlayerInAnyVehicle(targetid)) return SCM(playerid, COLOR_GREY, "Игрок не должен находиться в транспорте!");
	else if(!IsPlayerInRangeOfPlayer(8.0, playerid, targetid)) return SCM(playerid, COLOR_GREY, "Игрок слишком далеко!");
	else if(PI[playerid][pMember] != TEAM_ARMIYA && PI[targetid][pLevel] < 3) return SCM(playerid, COLOR_GREY, "У игрока нет 3 уровня!");
	else if(IsACop(playerid) && !PI[targetid][pVoennik]) return SCM(playerid, COLOR_GREY, "У игрока нет военного билета!");
	
	new string[256];
	SendMes(playerid,COLOR_BLUE,"Вы предложили %s присоединиться в вашу организацию",GetName(targetid));
	format(string,sizeof(string),"%s %s предлагает вам присоединиться к \"%s\"\n\nВы согласны?",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), Fraction_Name[PI[playerid][pMember]]);
	ShowPlayerDialog(targetid, D_INVITEFRAC, 0, "{ffa500}Вступление во фракцию",string,"Да","Нет");
	SetPVarInt(targetid, "offerfractionid", PI[playerid][pMember]);
	SetPVarInt(targetid, "offerplayer", playerid);
	SetPVarInt(playerid, "actplayerid", params[0]);
      printf("id member = %d", PI[playerid][pMember]);
      printf("id invited = %d", targetid);
	return 1;
}

 

 

Edited by stibs

Share this post


Link to post
Share on other sites

Скиньте полный текст, который пишет при принятии. И, да, фаркция игроку выдается ? В статистике у него потом отображается название фракции?

Share this post


Link to post
Share on other sites

@stibs Это все что было из этого, а там чат с этим.А фракция не выдается и т.д

Share this post


Link to post
Share on other sites

Диалог D_INVITESKIN замените тем, который я скину, и вновь скиньте логи. Вообще, в нем ошибок тоже нет.

case D_INVITESKIN:
{
    if(!response) return 1;
    new actplayerid = GetPVarInt(playerid, "actplayerid");
    new fractionid = PI[playerid][pMember];
    new skinid = Fraction_Skin[fractionid][listitem];
    PI[actplayerid][pMember] = fractionid;
    PI[actplayerid][pRank] = 1;
    PI[actplayerid][pMemberSkin] = skinid;
    SetPlayerSkin(actplayerid, skinid);
    PI[actplayerid][pJob] = 0;
    SetPlayerColorEx(actplayerid, TeamColors[GetTeamID(actplayerid)]);
    ResetPlayerWeaponsAC(actplayerid);
    new string[256];
    format(string, sizeof(string), "[F] %s %s[%d] принял в организацию %s[%d]",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]),PI[playerid][pName],playerid,PI[actplayerid][pName],actplayerid);
    SendFMes(PI[playerid][pMember], COLOR_YELLOW2, string);
    SendMes(actplayerid, COLOR_BLUE, "Вы присоединились к организации \"%s\"", Fraction_Name[fractionid]);
    SendMes(playerid, COLOR_BLUE, "%s принял предложение присоединиться к \"%s\"", GetName(actplayerid), Fraction_Name[fractionid]);
    printf("actplayerid = %d, fractionid = %d, fractionname = %s", actplayerid, fractionid, Fraction_Name[fractionid]);
}

 

Share this post


Link to post
Share on other sites

@stibs 

[11:04:50] id member = 1
[11:04:50] id invited = 2
[11:04:51] actplayerid = 50, fractionid = 1, fractionname = Правительство
[11:04:55] id member = 1
[11:04:55] id invited = 2
[11:04:57] actplayerid = 50, fractionid = 1, fractionname = Правительство

Но не принимает что бы не писалось в скобках

Share this post


Link to post
Share on other sites

@Daniil Roslyakov Вот мы и нашли ошибку. Ошибка в том, что неверное значение у PVaR "actplayerid". 50 ид на сервере, как я полагаю, не было. В будущем бы это вызвало большие проблемы. 

Команду попробуйте заменить этой, проблем быть не должно. 

Спойлер

CMD:invite(playerid, params[])
{
	if(!IsAbleToInvite(playerid)) return SCM(playerid, COLOR_GREY, YouCanNot);
	new targetid;
	if(sscanf(params, "u", targetid)) return SCM(playerid, COLOR_WHITE, "• {66CC00}[ Подсказка ] {ffffff}Введите: /invite [id игрока]");
	else if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_GREY, PlayerIsNotOnline);
	else if(PlayerLogged[targetid] == false) return SCM(playerid, COLOR_GREY, PlayerIsNotAuthorized);
	else if(PI[targetid][pLeader] > 0) return SCM(playerid, COLOR_GREY, "Игрок лидер другой организации!");
	else if(PI[targetid][pAdmin] > 0) return SCM(playerid, COLOR_GREY, "Администратору запрещено находится во фракции!");
	else if(PI[targetid][pMember] > 0) return SCM(playerid, COLOR_GREY, "Игрок находиться в другой организации!");
	else if(PI[targetid][pWarn] > 0) return SCM(playerid, COLOR_GREY, "У игрока предупреждение!");
	else if(IsPlayerInAnyVehicle(targetid)) return SCM(playerid, COLOR_GREY, "Игрок не должен находиться в транспорте!");
	else if(!IsPlayerInRangeOfPlayer(8.0, playerid, targetid)) return SCM(playerid, COLOR_GREY, "Игрок слишком далеко!");
	else if(PI[playerid][pMember] != TEAM_ARMIYA && PI[targetid][pLevel] < 3) return SCM(playerid, COLOR_GREY, "У игрока нет 3 уровня!");
	else if(IsACop(playerid) && !PI[targetid][pVoennik]) return SCM(playerid, COLOR_GREY, "У игрока нет военного билета!");
	
	new string[256];
	SendMes(playerid,COLOR_BLUE,"Вы предложили %s присоединиться в вашу организацию",GetName(targetid));
	format(string,sizeof(string),"%s %s предлагает вам присоединиться к \"%s\"\n\nВы согласны?",Fraction_Rang(PI[playerid][pMember],PI[playerid][pRank]), GetName(playerid), Fraction_Name[PI[playerid][pMember]]);
	ShowPlayerDialog(targetid, D_INVITEFRAC, 0, "{ffa500}Вступление во фракцию",string,"Да","Нет");
	SetPVarInt(targetid, "offerfractionid", PI[playerid][pMember]);
	SetPVarInt(targetid, "offerplayer", playerid);
	SetPVarInt(playerid, "actplayerid", targetid);
			
	return 1;
}

 

 

Share this post


Link to post
Share on other sites

@stibs Спасибо!!! Только на этом форме быстро решили проблему! А на сторонем был ждал 3 дня и 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

    • Leo_Carter
      By Leo_Carter
      Такая проблема то что я пишу мод с нуля и когда почти мод был готов, я решил его залить на хостинг, ну там есть подключение к mysql и всё подобное, только вот залил на хостинг, запускаю и у меня вот такие дебаги вылезают и сервер Unknown

       
      Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, (C)2005-2015 SA-MP Team [18:54:42] filterscripts = "" (string) [18:54:42] [18:54:42] Server Plugins [18:54:42] -------------- [18:54:42] Loading plugin: mysql_static.so [18:54:42] >> plugin.mysql: R39-2 successfully loaded. [18:54:42] Loaded. [18:54:42] Loading plugin: pawncmd.so [18:54:42] Pawn.CMD plugin v3.1.4 by urShadow loaded [18:54:42] Loaded. [18:54:42] Loading plugin: pawnregex.so [18:54:42] Pawn.Regex plugin v1.1 by urShadow loaded [18:54:42] Loaded. [18:54:42] Loading plugin: crashdetect.so [18:54:42] CrashDetect v4.18.1 is OK. [18:54:42] Loaded. [18:54:42] Loading plugin: streamer.so [18:54:42] *** Streamer Plugin v2.8.2 by Incognito loaded *** [18:54:42] Loaded. [18:54:42] Loading plugin: sscanf.so [18:54:42] [18:54:42] =============================== [18:54:42] sscanf plugin loaded. [18:54:42] Version: 2.8.1 [18:54:42] (c) 2012 Alex "Y_Less" Cole [18:54:42] =============================== [18:54:42] Loaded. [18:54:42] Loaded 6 plugins. [18:54:42] [18:54:42] Filterscripts [18:54:42] --------------- [18:54:42] Loaded 0 filterscripts. [18:54:42] [debug] Run time error 19: "File or function is not found" [18:54:42] [debug] cache_get_value_name [18:54:42] [debug] cache_get_value_name_int [18:54:42] [debug] Run time error 19: "File or function is not found" [18:54:42] [debug] cache_get_value_name [18:54:42] [debug] cache_get_value_name_int [18:54:42] Script[gamemodes/project.amx]: Run time error 19: "File or function is not found" [18:54:42] Number of vehicle models: 0 [18:54:42] [debug] Run time error 19: "File or function is not found" [18:54:42] [debug] cache_get_value_name [18:54:42] [debug] cache_get_value_name_int [18:54:42] [debug] Run time error 19: "File or function is not found" [18:54:42] [debug] cache_get_value_name [18:54:42] [debug] cache_get_value_name_int