SA-MP Forums Archive
/fltest - 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: /fltest (/showthread.php?tid=134062)



/fltest - iLcke - 15.03.2010

Код:
if(strcmp(cmd, "/fltest", true) == 0)
{
PlayerToPoint(10,playerid,1958.300048,-2184.000000,13.500000);
{
fltest[playerid] = 1;
SendClientMessage(playerid, TEAM_GROVE_COLOR, "FLYING TEST, get a shamal from the airport!");
AntiHack(playerid,-SBizzInfo[2][sbEntcost]);
SBizzInfo[2][sbTakings] = SBizzInfo[2][sbTakings]+SBizzInfo[2][sbEntcost];
return 1;
}
SendClientMessage(playerid, COLOR_RED, "ERROR: Your to far from airport gates!");
return 1;
}
player types /fltest they need to be by the airport gates,
but the thing is, you could be any where to do /fltest, but they gota be by the airport gates to do /fltest..


Meaning.. somethings wrong with the code..


Re: /fltest - sidhu123 - 15.03.2010

After the first return 1;, you didnt do "else" and set fltest[playerid] to 0.


Re: /fltest - iLcke - 15.03.2010

Quote:
Originally Posted by [SAP
Sidhu ]
After the first return 1;, you didnt do "else" and set fltest[playerid] to 0.
fltest needs to be 1, cause if its 0, they get in a shamal, flying test wont work..
EDIT: and im confussed else?


Re: /fltest - Sew_Sumi - 15.03.2010

Is this not missing an If statement somewhere?

And I'm sure he means that if you type /fltest somewhere else, it should return something and should also set the fltest = 0...


Re: /fltest - ev0lution - 15.03.2010

Your PlayerToPoint usage is incorrect, not to mention that there is now a native function for the same thing, IsPlayerInRangeOfPoint.

Код:
if(strcmp(cmd, "/fltest", true) == 0)
{
  if(IsPlayerInRangeOfPoint(playerid,10.0,1958.300048,-2184.000000,13.500000))
  {
    fltest[playerid] = 1;
    SendClientMessage(playerid, TEAM_GROVE_COLOR, "FLYING TEST, get a shamal from the airport!");
    AntiHack(playerid,-SBizzInfo[2][sbEntcost]);
    SBizzInfo[2][sbTakings] = SBizzInfo[2][sbTakings]+SBizzInfo[2][sbEntcost];
    return 1;
  }
  SendClientMessage(playerid, COLOR_RED, "ERROR: Your to far from airport gates!");
  return 1;
}
EDIT: Eh, Seif beat me to it, wrote this about 10 minutes ago and forgot to post it. :\


Re: /fltest - iLcke - 15.03.2010

oh! Thanks