HELP: /at400s command help
#1

I'm trying to make command for enter in at 400s

pawn Код:
stock bool:IsVehicleInUse(vehicleid)
{
    foreach(Player, i)
    {
       if(GetPlayerVehicleID(i) == vehicleid)
       {
          return (true);
       }
    }
    return (false);
}

stock bool:IsPlayerNearVehicle(playerid, Float:radius, vehicleid)
{
    new Float:Pos[3];
    GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
    if(IsPlayerInRangeOfPoint(playerid, radius, Pos[0], Pos[1], Pos[2]))
    {
        return (true);
    }
    return (false);
}

YCMD:at400s(playerid, params[], help)
{
   if(PlayerLogin{playerid} == false) return logout(playerid);
   else if(IsPlayerInAnyVehicle(playerid)) return (true);
   else
   {
      for(new v=0;v<MAX_VEHICLES;v++)
      {
          if(IsPlayerNearVehicle(playerid, 10.0, v) && GetVehicleModel(v) == 577)
          {
             if(!IsVehicleInUse(v))
             {
                PutPlayerInVehicle(playerid, v, PLAYER_STATE_DRIVER);
             }
          }
      }
   }
   return (true);
}
But it dosen't work im near empty at400s and when i use /at400s nothing happen.
Reply
#2

bump
Reply
#3

Debug it.
Reply
#4

ok, since nobody else is helping yet i'll try lol.
instead of saying "radius" why don't you just put the distance.

Not if(IsPlayerInRangeOfPoint(playerid, radius, Pos[0], Pos[1], Pos[2]))

But if(IsPlayerInRangeOfPoint(playerid, 20, Pos[0], Pos[1], Pos[2])) or whatever range you wanna use
Reply
#5

Radius is just in IsPlayerNearVehicle function, when i use that function i put radius....
if(IsPlayerNearVehicle(playerid, 10.0, v) && GetVehicleModel(v) == 577)

@C00K13M0N$73R i already did, and it stop on if(IsPlayerNearVehicle(playerid, 10.0, v) && GetVehicleModel(v) == 577)

I think it's problem in GetVehicleModel() code but i can't find...
Reply
#6

PlayerLogin{playerid} == false

Not sure how those work? Could you explain?

I've had similar issues on two occasions
1) My command would return a value from another function but instead broke off the entire function call (never got solved sadly as no one could find the issue)
2) I had a 3DTextLabel which had a radius of 10. I had to be almost on TOP of the freaking label to get it to show. I increased the distance to 50 and it showed normal.
Reply
#7

pawn Код:
new bool:PlayerLogin[MAX_PLAYERS char];
is checking if player logged
Reply
#8

YAY I found it lol

change PutPlayerInVehicle(playerid, v, PLAYER_STATE_DRIVER);
to PutPlayerInVehicle(playerid, v, 0);

it worked when i tested it, but i did notice that for it to work at 10 radius you need to be near the wheels of the plane under the wing lol 25 is good
Reply
#9

tny alot... it work's now tny again...
Reply
#10

no prob, glad I could help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)