[pomoc]Helper chat

Započeo Riv3R4, Novembar 04, 2013, 16:32:05 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta:GTARP
Problem: Ovako dakle napravio sam da na helper chaat mogu pricati admni i helperi, i da helper chat vide i admini ali sledeci problem se desava tj,kada helper pise u zagradi pise [Moderator] umjesto [helper lvl (njegov lvl)]

dio skripte:
COMMAND:helper(playerid, params[])
	{
	    if(IsPlayerConnected(playerid))
	    {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(params), idx, string[256];
			while ((idx < length) && (params[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = params[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, ""ORANGE"KORISTI: "WHITE"/he [helper chat]");
				return 1;
			}
			new arank[64];
			if(PlayerInfo[playerid][pHelp] == 1) { arank = "Level 1 Helper"; }
			else if(PlayerInfo[playerid][pHelp] == 2) { arank = "Level 2 Helper"; }
			else if(PlayerInfo[playerid][pHelp] == 3) { arank = "Level 3 Helper"; }
			else if(PlayerInfo[playerid][pHelp] == 4) { arank = "Level 4 Helper"; }
			else { arank = "Helper"; }
		    if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Moderator"; }
			else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Level 2 Admin"; }
			else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Level 3 Admin"; }
			else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Level 4 Admin"; }
			else if(PlayerInfo[playerid][pAdmin] == 1337) { arank = "Lead Admin"; }
			else if(PlayerInfo[playerid][pAdmin] == 1338) { arank = "Maper"; }
			else if(PlayerInfo[playerid][pAdmin] == 1339) { arank = "Direktor"; }
			else if(PlayerInfo[playerid][pAdmin] == 1340) { arank = "Vlasnik"; }
			else { arank = "Moderator"; }
			format(string, sizeof(string), "{0080C0}[H-CHAT]{FFFFFF}[%s] {0080C0}%s {FFFFFF}kaze: {0080C0}%s", arank, sendername, result);
			if (PlayerInfo[playerid][pHelp] >= 1)
			{
				SendHelperMessage(COLOR_YELLOW, string);
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_YELLOW, string);
			}
			printf("Helper %s: %s", sendername, result);
		}
		return 1;
	}

Probaj ovako samo zameni ovo Gamemaster u Helper :D

COMMAND:helper(playerid, params[])
	{
	    if(IsPlayerConnected(playerid))
	    {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(params), idx, string[256];
			while ((idx < length) && (params[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = params[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, ""ORANGE"KORISTI: "WHITE"/he [helper chat]");
				return 1;
			}
			new arank[124];
	                if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
	                else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
	                else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
	                else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Admin Level 4"; }
	                else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "HeadAdmin"; }
	                else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Owner"; }
	                else if(PlayerInfo[playerid][pAdmin] == 7) { arank = "Scripter"; }
	                else if(PlayerInfo[playerid][pGM] == 1) { arank = "GameMaster Level 1"; }
	                else if(PlayerInfo[playerid][pGM] == 2) { arank = "GameMaster Level 2"; }
	                else if(PlayerInfo[playerid][pGM] == 3) { arank = "GameMaster Level 3"; }
	                else if(PlayerInfo[playerid][pGM] == 4) { arank = "GameMaster Level 4"; }
			format(string, sizeof(string), "{0080C0}[H-CHAT]{FFFFFF}[%s] {0080C0}%s {FFFFFF}kaze: {0080C0}%s", arank, sendername, result);
			if (PlayerInfo[playerid][pHelp] >= 1)
			{
				SendHelperMessage(COLOR_YELLOW, string);
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_YELLOW, string);
			}
			printf("Helper %s: %s", sendername, result);
		}
		return 1;
	}
Poslednja Izmena: Novembar 04, 2013, 16:57:04 POSLE PODNE od n0le

resio sam ja to na neki svoj improvizovan nacin kao i uvijek :D hvala svima koji su pokusali pomoci