[Pomoc]Local OOC

Započeo Drobnjak, Jul 12, 2013, 13:51:21 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim:MC:RP
Detaljan opis problema:Pa kad pisem na /b pise samo (OOC): I sta sam reko,ne pise ime od tog koji je reko,kako da fixam to?
Dio skripte:
//==============================================================================
	if(strcmp(cmd, "/b", true) == 0)//local ooc 
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "** Niste se ulogovali !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete da pricate, ucutkani ste.");
				return 1;
			}

			new y,m,d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /b [local ooc chat]");
				return 1;
			}
			if(PlayerInfo[playerid][pAdminDuty] == 1)
			{
				format(string, sizeof(string), "{157DEC}(OOC){FFFFFF} Admin kaze: %s ", result);
				SetPlayerChatBubble(playerid, string, COLOR_NICERED, 20.0, 8000);
				ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local OOC -Admin-): %s",d,m,y,h,mi,s, sendername, result);
				ChatLog(string);
			}
			if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 1)
			{
				format(string, sizeof(string), "{157DEC}(OOC){FFFFFF} Stranac kaze: %s ", result);
				SetPlayerChatBubble(playerid, string, COLOR_WHITE, 20.0, 8000);
				ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local OOC -Masked-): %s",d,m,y,h,mi,s, sendername, result);
				ChatLog(string);
			}
			if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 0)
			{
		   		format(string, sizeof(string), "{157DEC}(OOC){FFFFFF} %s kaze: %s ", sendername, result);
		   		SetPlayerChatBubble(playerid, string, COLOR_WHITE, 20.0, 8000);
				ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local OOC): %s",d,m,y,h,mi,s, sendername, result);
				ChatLog(string);
			}
		}
		return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno): http://zaslike.com/files/chzhn7eqvy9ro7wrhcei.png

Mozda sam slijep al ja tu nigdje ne vidim sendername,probaj umjesto toga koristit funkciju GetName.

stock GetName(playerid)
{
   new pname[MAX_PLAYER_NAME]; pname="Invalid PlayerID";
   if(IsPlayerConnected(playerid)) {
      GetPlayerName(playerid, pname, sizeof (pname));
   }
   return pname;
}

Samo dodaj u komandu

GetPlayerName(playerid, sendername, sizeof(sendername));
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).