Weird command fail (again...)
#1

Hey guys,

Once again i messed up my script, and i dont know what i did wrong. I just added a simple command (akill), and then it was like poof bye bye admin script.. When i delete the akill command, it works 100%, and i dont get any problems

pawn Код:
dcmd_akill(playerid, params[])
    {
        new Player2;
        if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
        {
            new string[128];
            format(string, sizeof(string), "You must be a level %d administrator to use that command!", gCommands[AKILL]);
            SendClientMessage(playerid, COLOR_ORANGE, string);
        }
            else if (sscanf(params, "u", Player2)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /akill [playerid]");
            else if (Player2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "Player not Connected");
            else {
            SendClientMessage(Player2, COLOR_RED, "You have been killed by an admin");
            SetPlayerHealth(Player2, 0);
        }
        return 0;
    }
It is this command, there are no errors when i compile, just when i start up the server; it doesnt print the line i putted on OnFilterScriptInit (This is JUST when i HAVE the command in it, when i comment it; the line prints)

Anyone could check it?

Thanks
~Wesley
Reply
#2

Could anyone please check this?
Reply
#3

Try this out

pawn Код:
dcmd_akill(playerid, params[])
{
    new Player2, string[128];
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        if (sscanf(params, "u", Player2)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /akill [playerid]");
        if (Player2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "Player not Connected");
        SendClientMessage(Player2, COLOR_RED, "You have been killed by an admin");
        SetPlayerHealth(Player2, 0);
    }
    else format(string, sizeof(string), "You must be a level %d administrator to use that command!", gCommands[AKILL]);
    SendClientMessage(playerid, COLOR_ORANGE, string);
    return 1;
}
Reply
#4

Nope, still doesnt print the line when i start the server...
Reply
#5

What are you trying to print?
Reply
#6

Its just a line in "OnFilterScriptInit", that prints a line that it loads my FS.. Just a test print to check if its working

pawn Код:
print("Admin System by Wesley");
Just that, so no big problem with that
The whole FS works, just when i add that command; it stops working
Reply
#7

So.. no one who knows the problem?
Reply
#8

Show OnPlayerFilterScriptInit
Reply
#9

pawn Код:
public OnFilterScriptInit()
    {
    print("This admin system have been made by Wesley");
       
        if(!fexist(CommandFile))
        {
            dini_Create(CommandFile);
            dini_IntSet(CommandFile, "Flip", 2);
            dini_IntSet(CommandFile, "Nitro", 2);
            dini_IntSet(CommandFile, "Fixme", 3);
            dini_IntSet(CommandFile, "Akill", 5);
        }

        gCommands[FLIP] = dini_Int(CommandFile, "Flip");
        gCommands[NITRO] = dini_Int(CommandFile, "Nitro");
        gCommands[FIXME] = dini_Int(CommandFile, "Fixme");
        gCommands[AKILL] = dini_Int(CommandFile, "Akill");
        return 1;
    }
Reply
#10

Anyone knows?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)