String Command error
#1

Hello. I want my command to be shown like this.

AdminRank ServerName / ForumName (On Duty)
AdminRank ServerName / ForumName (Off Duty)


But instead, it shows like this.

AdminRank Servername AdminRank2 ServerName2 (without line break.)


And, I want to add a new command /forumname and to show if admin is adminduty.

Can you help me? Beside that, if no admin is online, it won't show the " Nici un admin online"

My command

Code:
CMD:admins(playerid, params[])
{
	if(pInfo[playerid][pHour] >= 0)
	{
	    new adminstring[128];
	    new text[128];
	    if(IsPlayerConnected(playerid))
	    {
	        for (new i = 0; i < MAX_PLAYERS; i++)
	        {
	            if(IsPlayerConnected(i))
	            {
	                if(pInfo[i][pAdminLevel] > 0)
	                {
	                    format(adminstring, sizeof(adminstring),"%s%s %s\n / %s", adminstring, GetAdminName(i), PlayerName(i), ForumName(i));
                        format(text, sizeof(text),"Administratori Online");
	                }
	            }
	        }
	        SendClientMessage(playerid,COLOR_WHITE, text);
	        SendClientMessage(playerid,COLOR_GREEN, adminstring);
		}
 		else return SendClientMessage(playerid,-1,"*"COL_LGREEN" Nici un admin online");
	}
    return 1;
}

ForumName command

Code:
CMD:forumname(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 5)
	{
		new targetid,nume,string[180];
		if(sscanf(params, "ud", targetid, nume)) return  SendClientMessage(playerid,-1,""chat" /forumname [playerid] [nume]");
		if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");

        pInfo[targetid][ForumName] = nume;

		format(string, sizeof(string), "*"COL_RED" %s %s i-a setat numele de forum la %d lui %s",GetAdminName(playerid),PlayerName(playerid),nume,PlayerName(targetid));
		SendMessageToAllAdmins(string, -1);
	}
	else {
		SendClientMessage(playerid,-1,"*"COL_RED" Nu esti autorizat sa folosesti comanda!");
	}
	return 1;
}
aduty cmd

HTML Code:
CMD:aduty(playerid, params[])
{

	if (pInfo[playerid][pAdminLevel] < 1)
	    return SendClientMessage(playerid,COLOR_WHITE, "Nu esti Admin.");


    if (!pInfo[playerid][pAdminDuty])
	{
		SetPlayerColor(playerid,COLOR_PURPLE);
		SetPlayerSkin(playerid,280);


		pInfo[playerid][pAdminDuty] = 1;

        new string[128];
        GetPlayerName(playerid, string, 24);
        format(string, sizeof(string), "{FF0000} %s este acum Admin Duty. Foloseste (/report) pentru a cere ajutor" ,string);
		SendClientMessageToAll(-1, string);
	}
	else
	{
	    SetPlayerColor(playerid, COLOR_WHITE);
	    SetPlayerSkin(playerid,NORMAL);

		pInfo[playerid][pAdminDuty] = 0;
		new str[76], name[24];
        GetPlayerName(playerid, name, 24);
        format(str, sizeof(str), "{FF0000}%s nu mai este Admin Duty", name);
        SendClientMessageToAll(COLOR_GREEN, str);
	}
	return 1;
}
Reply


Messages In This Thread
String Command error - by Zeus666 - 13.03.2018, 20:56
Re: String Command error - by Zeus666 - 13.03.2018, 21:10
Re: String Command error - by AdamsLT - 13.03.2018, 21:32
Re: String Command error - by Zeus666 - 13.03.2018, 21:43
Re: String Command error - by Zeus666 - 14.03.2018, 09:37
Re: String Command error - by Sew_Sumi - 14.03.2018, 09:44
Re: String Command error - by Zeus666 - 14.03.2018, 10:23
Re: String Command error - by Sew_Sumi - 14.03.2018, 11:41
Re: String Command error - by Zeus666 - 14.03.2018, 11:48
Re: String Command error - by Maximun - 14.03.2018, 12:51

Forum Jump:


Users browsing this thread: 1 Guest(s)