SA-MP Forums Archive
Roleplay Gamemode Chat Bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Roleplay Gamemode Chat Bug (/showthread.php?tid=504738)



Roleplay Gamemode Chat Bug - John_Black96 - 05.04.2014

Hello guys, i'm working on a Project for a great Italian Roleplay, the problem is that there is a really really strange bug. It happens that sometimes, a player gets a bug and he can't see the others talking, but the others can see him. The bugged player can still join the Houses, or do commands, he just can't read what the others say. And the strange thing is that the only thing he can read is /pm. What could be the problem of this bug? please give me some suggestions!


Re: Roleplay Gamemode Chat Bug - Lidor124 - 05.04.2014

Might its on public OnPlayerText, post it here.


Re: Roleplay Gamemode Chat Bug - Sledgehammer - 05.04.2014

Is this when an player register's (the variable isn't correct) or does this happen all the time at random. If so, do you know where about this happens the most?


Re: Roleplay Gamemode Chat Bug - John_Black96 - 05.04.2014

It happens totally randomly, what do you mean with "where"? The Location?


Re: Roleplay Gamemode Chat Bug - John_Black96 - 07.04.2014

Here is the OnPlayerText!



Quote:

public OnPlayerText(playerid, text[]) {
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 0;
new string[256];

if(GetPVarInt(playerid, "InCall911") != 0) {
if(PlayerInfo[playerid][pLeader] == 1) format(string, sizeof(string), "[911] %s(%d): %s", pName(playerid), playerid, text);
if(PlayerInfo[playerid][pLeader] != 1) format(string, sizeof(string), "[911] %s(%d): %s", pName(playerid), playerid, text);
SendSplitMessageNormal(GetPVarInt(playerid, "InCall911"), COLOR_WHITE, string);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
printf(string); return 0; }

if(Mobile[playerid] != 255) {
//
ApplyAnimation(playerid,"PED","phone_talk",4.1,0,1 ,1,1,1);
if(!IsPlayerConnected(Mobile[playerid])) {
if(!IsPlayerInAnyVehicle(playerid)) { CreaInfoTDRight(playerid, "We.", 4000); }
if(IsPlayerInAnyVehicle(playerid)) { SetTimerEx("timePCA", 2000, false,"i", playerid); }
Mobile[playerid] = 255; InCellulare[playerid] = 0; }
//
if(IsPlayerConnected(Mobile[playerid]) && Mobile[Mobile[playerid]] != playerid) {
CreaInfoTDRight(playerid, "Il Player non ha ancora Risposto!", 5000); }
//
if(IsPlayerConnected(Mobile[playerid]) && Mobile[Mobile[playerid]] == playerid) {
new caller = Mobile[playerid];
if(PlayerInfo[playerid][pMaskuse] == 1 || PlayerInfo[playerid][pCascoUse] == 1) { format(string, sizeof(string), "Sconosciuto %d dice (cellulare): %s", VarCodeMask[playerid], text); }
if(PlayerInfo[playerid][pMaskuse] == 0 && PlayerInfo[playerid][pCascoUse] == 0) { format(string, sizeof(string), "%s dice (cellulare): %s", pName(playerid), text); }
ProxDetector(15.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,CO LOR_FADE5);
SendSplitMessageNormal(caller, COLOR_WHITE, string); }
return 0; }

if(PlayerInfo[playerid][pMaskuse] == 1 || PlayerInfo[playerid][pCascoUse] == 1) {
format(string, sizeof(string), "Sconosciuto %d dice: %s", VarCodeMask[playerid], text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
printf(string);
return 0; }
if(PlayerInfo[playerid][pCascoUse] == 0 && PlayerInfo[playerid][pMaskuse] == 0) {
format(string, sizeof(string), "%s dice: %s", pName(playerid), text);
ProxDetector(20.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,CO LOR_FADE5);
printf(string);
return 0; }
return 0; }




Re: Roleplay Gamemode Chat Bug - Lidor124 - 07.04.2014

Quote:
Originally Posted by John_Black96
Посмотреть сообщение
Here is the OnPlayerText!
Your public OnPlayerText looks okay, but give it a try: (backup your original public)

Код:
public OnPlayerText(playerid, text[]) 
{
	new string[128];
	if(GetPVarInt(playerid, "InCall911") != 0) 
	{
		if(PlayerInfo[playerid][pLeader] == 1) format(string, sizeof(string), "[911] %s(%d): %s", pName(playerid), playerid, text);
		if(PlayerInfo[playerid][pLeader] != 1) format(string, sizeof(string), "[911] %s(%d): %s", pName(playerid), playerid, text);
		SendSplitMessageNormal(GetPVarInt(playerid, "InCall911"), COLOR_WHITE, string);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
		printf(string);
		return 0;
	}

	if(Mobile[playerid] != 255) 
	{
		ApplyAnimation(playerid,"PED","phone_talk",4.1,0,1 ,1,1,1);
		if(!IsPlayerConnected(Mobile[playerid])) {
		if(!IsPlayerInAnyVehicle(playerid)) { CreaInfoTDRight(playerid, "We.", 4000); }
		if(IsPlayerInAnyVehicle(playerid)) { SetTimerEx("timePCA", 2000, false,"i", playerid); }
		Mobile[playerid] = 255; InCellulare[playerid] = 0; 
	}
	if(IsPlayerConnected(Mobile[playerid]) && Mobile[Mobile[playerid]] != playerid) 
	{
		CreaInfoTDRight(playerid, "Il Player non ha ancora Risposto!", 5000); 
	}
		
	if(IsPlayerConnected(Mobile[playerid]) && Mobile[Mobile[playerid]] == playerid) 
	{
	new caller = Mobile[playerid];
	if(PlayerInfo[playerid][pMaskuse] == 1 || PlayerInfo[playerid][pCascoUse] == 1) 
	{ 
		format(string, sizeof(string), "Sconosciuto %d dice (cellulare): %s", VarCodeMask[playerid], text); 
	}
	if(PlayerInfo[playerid][pMaskuse] == 0 && PlayerInfo[playerid][pCascoUse] == 0) { format(string, sizeof(string), "%s dice (cellulare): %s", pName(playerid), text); 
	}
		ProxDetector(15.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,CO LOR_FADE5);
		SendSplitMessageNormal(caller, COLOR_WHITE, string); 
		return 0;
	}

	if(PlayerInfo[playerid][pMaskuse] == 1 || PlayerInfo[playerid][pCascoUse] == 1) 
	{
		format(string, sizeof(string), "Sconosciuto %d dice: %s", VarCodeMask[playerid], text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
		printf(string);
		return 0;
	}
	if(PlayerInfo[playerid][pCascoUse] == 0 && PlayerInfo[playerid][pMaskuse] == 0) 
	{
		format(string, sizeof(string), "%s dice: %s", pName(playerid), text); 
		ProxDetector(20.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,CO LOR_FADE5);
		printf(string);
	}
	return 0;
}