Code stops at certain point
#1

pawn Код:
if(strcmp(cmdtext, "/dgate", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 263.70001220703, -1333, 55.700000762939)) return SendClientMessage(playerid, COLOR_GREY, "* You are not at Dills gate!");
        new gatepass[256], string2[256];
        format(string2, sizeof(string2), "Dill_Bellum.ini");
        if(!fexist(string2)) return SendClientMessage(playerid, COLOR_GREY, "* Cannot find Dill Bellum's userfile!");
        gatepass = dini_Get(string2, "pGatePassword");
        print("Stage 1");
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "* Dills gate requires a password !");
        if(!strcmp(gatepass, tmp))
        {
            print("Correct pass");
            if(dillsgate == 0)
            {
                MoveObject(dillsgateobj, 263.70001220703, -1333, 55.700000762939, 1.5);
                GameTextForPlayer(playerid, "~g~Opening ~w~Dills gate...", 2500, 3);
                dillsgate = 1;
                return 1;
            }
            if(dillsgate == 1)
            {
                MoveObject(dillsgateobj, 263.70001220703, -1333, 48.700000762939, 1.5);
                GameTextForPlayer(playerid, "~r~Closing ~w~Dills gate...", 2500, 3);
                dillsgate = 0;
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "* Dills gate: Incorrect password !");
            print("Incorrect pass");
            return 1;
        }
        return 1;
    }
It stops at:
pawn Код:
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "* Dills gate requires a password !");
Reply
#2

Hint: Strtok sucks!
Reply
#3

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
Hint: Strtok sucks!
True, as soon as I changed to dcmd and just used the params, it worked :P fixed aye
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)