Problem with Kane_Phoenix's fuel system
#1

I've got problem that I can't solve by myself... Kane_Phoenix's fuel system, modified by me (but that doesn't matter, the original version does the same) completely messes my gamemode's commands - I can't use any command scripted there - game just sends message "You are not in a gas station". Commands in other filterscripts (LAdmin and mine Infosystem) work flawlessly. I thought I knew what caused the problem (returns or if/else) but i failed miserably, so could you help me fix it? I spent a lot of time trying to adjust this script and i like it (besides it's not perfect, e.g. stopped car still guzzles the gas), so I don't wanna scrap it just because of conflicts...

Here's the pastebin: http://pastebin.com/m7ef21343

Thanks in advance for your help!
Reply
#2

What Gamemode are you using? because this FS could be interfering with a already built in gas system inside the gamemode.
Reply
#3

Look at the end of OnPlayerCommandText in the filterscript, It it has somthing like return SendClientMessage(...) instead of return 0; then change it to return 0;
Reply
#4

Ok I'll try it later, I hope it'll work...
EDIT: I'll fixed it, dunno what helped but now callback looks like that:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/fill", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsAtGasStation(playerid))
            {
                new Float:olddistance = 999999;
                new Float:newdistance;
                new closest = -1;
                new Float:GasX,Float:GasY,Float:GasZ;
                for (new i = 0; i < sizeof(gGasStationLocations); i++)
                {
                    GasX = gGasStationLocations[i][0];
                    GasY = gGasStationLocations[i][1];
                    GasZ = gGasStationLocations[i][2];
                    newdistance = GetDistanceBetweenPlayerToPoint(playerid,GasX,GasY,GasZ);
                    if (newdistance < olddistance)
                    {
                        olddistance = newdistance;
                        closest = i;
                        return 1;
                    }
                    return 1;
                }
                SendClientMessage(playerid,COLOR_LIGHTBLUE,"Refueling! Please wait...");
                SetTimer("Fillup",RefuelWait,0);
                gGasBiz[playerid] = closest+12;
                Refueling[playerid] = 1;
                return 1;
            }
            SendClientMessage(playerid,COLOR_GREY,"You are not an a Gas Station!");
            return 1;
        }
        return 1;
    }
    return 0;
}
Thanks for your help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)