Problem with Kane_Phoenix's fuel system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with Kane_Phoenix's fuel system (
/showthread.php?tid=70419)
Problem with Kane_Phoenix's fuel system -
DiDok - 24.03.2009
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!
Re: Problem with Kane_Phoenix's fuel system -
jat1801 - 24.03.2009
What Gamemode are you using? because this FS could be interfering with a already built in gas system inside the gamemode.
Re: Problem with Kane_Phoenix's fuel system -
ICECOLDKILLAK8 - 24.03.2009
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;
Re: Problem with Kane_Phoenix's fuel system -
DiDok - 25.03.2009
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!