Only 2 help
#1

Код:
COMMAND:clearchat(playerid)  {
    if (PInfo[playerid][LoggedIn] == true)
    {
        if (PInfo[playerid][PlayerLevel] > 3)
        {
        	for(new i = 0; i < 100; i++) SendClientMessageToAll(-1, " " );
    	} else {
        return SendClientMessage(playerid,-1,"{FF0000}ERROR: This command is only avaible for admins.");
    }
    return 1;
}
There is a error but there is no line... number: 21669
Код:
E:\WOT\gamemodes\555.pwn(21667) : warning 217: loose indentation
E:\WOT\gamemodes\555.pwn(21669) : error 030: compound statement not closed at the end of file (started at line 21659)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
]

another problem:

Код:
CMD:ann(playerid, params[])
{
    if (PInfo[playerid][LoggedIn] == true)
    {
        if (PInfo[playerid][PlayerLevel] > 3)
        {
            new msg[200];
            if (sscanf(params, "s[200]", msg)) return SendClientMessage(playerid, -1, "Usage: /ann [message/announce]");

            if (IsPlayerConnected(playerid))
            {
                GameTextForAll(msg, 1000, 0);
            }
        }
        else return SendClientMessage(playerid, -1, "{FF0000}ERROR: you need to be atleast admin level 3 to use this command");
    }
    return 1;
}
I want this command only for admin level 3 + But it shows i need to be rcon.
And it shouldn't be lower than level 3
Reply
#2

The first one your indentation is off and your missing a }

Second one i assume your testing it as a level 3 player? If so change
pawn Код:
if (PInfo[playerid][PlayerLevel] > 3)
//to
if (PInfo[playerid][PlayerLevel] >= 3) //greater than or equal too level 3
Reply
#3

But where should i add }?
Reply
#4

you were missing =
pawn Код:
if (PInfo[playerid][PlayerLevel] > 3)
pawn Код:
if (PInfo[playerid][PlayerLevel] >= 3)
fixed

pawn Код:
COMMAND:clearchat(playerid)  
{
    if (PInfo[playerid][LoggedIn] == true)
    {
        if (PInfo[playerid][PlayerLevel] >= 3)
        {
        for(new i = 0; i < 100; i++) SendClientMessageToAll(0x00000000," ");
 
        }
      }
       else return SendClientMessage(playerid,-1,"{FF0000}ERROR: This command is only avaible for admins.");    
    return 1;
}

pawn Код:
CMD:ann(playerid, params[])
{
    if (PInfo[playerid][LoggedIn] == true)
    {
        if (PInfo[playerid][PlayerLevel] >= 3)
        {
            new msg[200];
            if (sscanf(params, "s[200]", msg)) return SendClientMessage(playerid, -1, "Usage: /ann [message/announce]");

            if (IsPlayerConnected(playerid))
            {
                GameTextForAll(msg, 1000, 0);
            }
        }
        else return SendClientMessage(playerid, -1, "{FF0000}ERROR: you need to be atleast admin level 3 to use this command");
    }
    return 1;
}
Reply
#5

Still same:
E:\WOT\gamemodes\555.pwn(2166 : warning 217: loose indentation
E:\WOT\gamemodes\555.pwn(21670) : error 030: compound statement not closed at the end of file (started at line 21660)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Try this for clearchat

pawn Код:
CMD:clearchat(playerid, params[])
{
    if (PInfo[playerid][LoggedIn] == true)
    {
        if (PInfo[playerid][PlayerLevel] >= 3)
        {
            for(new i = 0; i < 100; i++) SendClientMessageToAll(-1, " " );
        }
        else return SendClientMessage(playerid,-1,"{FF0000}ERROR: This command is only avaible for admins.");
    }
    return 1;
}
Reply
#7

Fixed it thanks.
Another error:
Код:
E:\loT\gamemodes\555.pwn(11093) : error 017: undefined symbol "Name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
my codes:
Код:
	new LetAllKnow[285],sString[1024];
	format(sString,sizeof(sString),"{FFCC00}News: %s has sold house id %s", Name, AHouseData[HouseID], LetAllKnow);
	SendClientMessageToAll(0xFFFFFFFF,sString);
Reply
#8

why are you using LetAllKnow ?? your not even using it somewhere

then try this


pawn Код:
new sString[1024],Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Name , sizeof(Name));
    format(sString,sizeof(sString),"{FFCC00}News: %s has sold house id %d", Name, AHouseData[HouseID]);
    SendClientMessageToAll(0xFFFFFFFF,sString);
Reply
#9

Announce, Make it simple.
pawn Код:
CMD:ann(playerid, params[])
{
    if (PInfo[playerid][LoggedIn] == false) return 1;
    if(PInfo[playerid][PlayerLevel] < 3) return SendClientMessage(playerid, -1, "{FF0000}ERROR: you need to be atleast admin level 3 to use this command");
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /ann [message/announce]");
    GameTextForAll(params,1000,0);
    return 1;  
}
Reply
#10

Код:
E:\WOT\gamemodes\555.pwn(11093) : error 017: undefined symbol "name"
E:\WOT\gamemodes\555.pwn(11093) : error 029: invalid expression, assumed zero
E:\WOT\gamemodes\555.pwn(11093) : warning 215: expression has no effect
E:\WOT\gamemodes\555.pwn(11096) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
@Namer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)