PDA

View Full Version : OOC help


ChromeMenu
03/04/2014, 01:43 AM
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
}

AhmedMohamed
03/04/2014, 01:44 AM
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??

ChromeMenu
03/04/2014, 01:53 AM
I edited it in the script, so you can see them because some are just brackets and now you know.

AhmedMohamed
03/04/2014, 01:55 AM
it will be like that:

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

ChromeMenu
03/04/2014, 09:39 PM
It is supposed to show this( {f6970c} ) color if you're on admin duty, but it doesn't. Anyone know why?

zT KiNgKoNg
03/04/2014, 09:46 PM
Well if you look at the code this is why.


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);
}