OOC help
#1

warning 217: loose indentation
error 029: invalid expression, assumed zero
warning 217: loose indentation
warning 209: function "cmd_b" should return a value
error 010: invalid function or declaration

Код:
 command(b, playerid, params[])
{
	new Message[128], string[128];
	if(sscanf(params, "z", Message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /b [message]");
	}
	else
	{
	    if(strlen(Message) < 1 || !IsPlayerConnectedEx(playerid))
	    {
	        return 1;
	    }
	    else
	    {
	        if(Player[playerid][PrisonID] == 1)
	        {
				SendClientMessage(playerid, WHITE, "You may not use this channel right now.");
	   	    }
 		      else
   	     {
		    	format(string, sizeof(string), "(( %s says: %s ))", GetName(playerid), Message);
		    	OOCChatLog(string);
				NearByMessage(playerid, GREY, string);
				
				}
				else Warning 217: loose indentation error 029: invalid expression, assumed zero
 			{ Warning 217: loose indentation
   					if(Player[playerid][AdminLevel] == 1)
 		    	{
    			format(string, sizeof(string), "(( {f6970c}%s says: %s ))", GetName(playerid), Message);
		    	OOCChatLog(string);
				NearByMessage(playerid, GREY, string);
				}
			}
   }
		}
	} Warning 209: function "cmd_b" should return a value
	return 1; Error 010: invalid function or declaration
}
Reply
#2

Код:
warning 217: loose indentation
error 029: invalid expression, assumed zero
warning 217: loose indentation
warning 209: function "cmd_b" should return a value
error 010: invalid function or declaration
these errors for which line??
Reply
#3

I edited it in the script, so you can see them because some are just brackets and now you know.
Reply
#4

it will be like that:
pawn Код:
command(b, playerid, params[])
{
    new Message[128], string[128];
    if(sscanf(params, "z", Message))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /b [message]");
    }
    else
    {
        if(strlen(Message) < 1 || !IsPlayerConnectedEx(playerid))
        {
            return 1;
        }
        else
        {
            if(Player[playerid][PrisonID] == 1)
            {
            SendClientMessage(playerid, WHITE, "You may not use this channel right now.");
        }
        else
            {
          format(string, sizeof(string), "(( %s says: %s ))", GetName(playerid), Message);
           OOCChatLog(string);
           NearByMessage(playerid, GREY, string);      
            }
                else
            {
           if(Player[playerid][AdminLevel] == 1)
           {
                format(string, sizeof(string), "(( {f6970c}%s says: %s ))", GetName(playerid), Message);
                OOCChatLog(string);
            NearByMessage(playerid, GREY, string);
            }
        }
              }
        }
    return 1;
}
tell me if there is any errors
Reply
#5

It is supposed to show this( {f6970c} ) color if you're on admin duty, but it doesn't. Anyone know why?
Reply
#6

Well if you look at the code this is why.

pawn Код:
if(Player[playerid][AdminLevel] == 1) // < Replace with the var that saves if the player is on admin duty, EG. if(StaffDuty[playerid))
           {
                format(string, sizeof(string), "(( {f6970c}%s says: %s ))", GetName(playerid), Message);
                OOCChatLog(string);
                NearByMessage(playerid, GREY, string);
            }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)