VERY STRANGE!
#1

Well, before merge ladmin with my gamemode it worked like a charm, afteri merged it with the gamemode.

All the commands where fucked up!
All i did was copy paste, didn't change a thing, and also included #include <lethaldudb2>


When i try to change score, it says something about highest admin, but he is just a normal player.

When i want to set someone's level, it says Invalid level or something like that.
I know very well pawn, but this gave me headaches...All i have is

foreach
lethaldudb2

as includes included.

DO i need to show any codes? tell me, i would appreciate very very much if someone would actually help me.

Will be in credits
Reply
#2

And you are sure that you did not overwrite any existing functions, or have a function double placed?
Do you get any warnings on compiling?

Edit: I don't know why I came up with this, but do you use "#pragma tabsize 0"? I heard it could screw up somethings that the the compiler would show without using it.
Reply
#3

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
And you are sure that you did not overwrite any existing functions, or have a function double placed?
Do you get any warnings on compiling?

Edit: I don't know why I came up with this, but do you use "#pragma tabsize 0"? I heard it could screw up somethings that the the compiler would show without using it.
I never use tabsize 0, it's just for NOOBS!
My gamemode is pro indented...I have no idea.
No warnings, and no errors.
Maybe it comes from foreach?that screws up loops and stuff?
Reply
#4

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
I never use tabsize 0, it's just for NOOBS!
My gamemode is pro indented...I have no idea.
No warnings, and no errors.
Maybe it comes from foreach?that screws up loops and stuff?
If you've already used foreach before placing ladmin into your script, I don't think so.

Does this also happen to the commands you already had, or only to ladmin?

Also, would it be possible to place some "failing" code? Just one or two snippets would do it.
Reply
#5

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
If you've already used foreach before placing ladmin into your script, I don't think so.

Does this also happen to the commands you already had, or only to ladmin?

Also, would it be possible to place some "failing" code? Just one or two snippets would do it.
Checked every single public and stock and other functions.

And yes..i used it before including lethaldudb2/.

This happens only to ladmin.

Maybe DCMD is screwed up...i have no idea, i ran out of
Reply
#6

Show me some of the ladmin commands if you could, and perhaps your DCMD (The #define)?
Reply
#7

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Show me some of the ladmin commands if you could, and perhaps your DCMD (The #define)?
I checked define from ladmin script and the on from gm, IDENTICAL!



pawn Код:
dcmd_setlevel(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid)) {
            new tmp[256], tmp2[256], Index;     tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /setlevel [playerid] [level]");
            new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);
            if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setlevel [playerid] [level]");
            level = strval(tmp2);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
                if(PlayerInfo[player1][LoggedIn] == 1) {
                    if(level > ServerInfo[MaxAdminLevel] ) return SendClientMessage(playerid,red,"ERROR: Incorrect Level");
                    if(level == PlayerInfo[player1][Level]) return SendClientMessage(playerid,red,"ERROR: Player is already this level");
                    CMDMessageToAdmins(playerid,"SETLEVEL");
                    GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
                    new year,month,day;   getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);

                    if(level > 0) format(string,sizeof(string),"Administrator %s has set you to Administrator Status [level %d]",adminname, level);
                    else format(string,sizeof(string),"Administrator %s has set you to Player Status [level %d]",adminname, level);
                    SendClientMessage(player1,blue,string);

                    if(level > PlayerInfo[player1][Level]) GameTextForPlayer(player1,"Promoted", 2000, 3);
                    else GameTextForPlayer(player1,"Demoted", 2000, 3);

                    format(string,sizeof(string),"You have made %s Level %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second); SendClientMessage(playerid,blue,string);
                    format(string,sizeof(string),"Administrator %s has made %s Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, level, day, month, year, hour, minute, second);
                    SaveToFile("AdminLog",string);
                    dUserSetINT(PlayerName2(player1)).("level",(level));
                    PlayerInfo[player1][Level] = level;
                    return PlayerPlaySound(player1,1057,0.0,0.0,0.0);
                } else return SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be admin");
            } else return SendClientMessage(playerid, red, "Player is not connected");
        } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Maybe there is a strtok problem, something isn't right...?
Reply
#8

Have you been using strtok before implementing ladmin? There might be a problem with the type of it (for example, there also is a strtok that splits a string)

Edit: If so, try placing ladmin's strtok in your script, instead of your current one. (Place the current one between comments though)
Reply
#9

pawn Код:
stock strtok(const string[], &index,seperator=' ')
{
    new length = strlen(string);
    new offset = index;
    new result[MAX_STRING];
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }

    result[index - offset] = EOS;
    if ((index < length) && (string[index] == seperator))
    {
        index++;
    }
    return result;
}
Took from dutils, wich is included trough lethaldudb2....

Got nothing else in gm as strtok...
Reply
#10

Sorry, didn't read carefully.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)