HELP: /at400s command help -
DarkPower - 16.09.2012
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.
Re: HELP: /at400s command help -
DarkPower - 16.09.2012
bump
Re: HELP: /at400s command help -
C00K13M0N$73R - 16.09.2012
Debug it.
Re: HELP: /at400s command help -
[FAT]Klabauter[LST] - 16.09.2012
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
Re: HELP: /at400s command help -
DarkPower - 16.09.2012
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...
Re: HELP: /at400s command help -
mamorunl - 16.09.2012
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.
Re: HELP: /at400s command help -
DarkPower - 17.09.2012
pawn Код:
new bool:PlayerLogin[MAX_PLAYERS char];
is checking if player logged
Re: HELP: /at400s command help -
[FAT]Klabauter[LST] - 17.09.2012
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
Re: HELP: /at400s command help -
DarkPower - 17.09.2012
tny alot... it work's now
tny again...
Re: HELP: /at400s command help -
[FAT]Klabauter[LST] - 17.09.2012
no prob, glad I could help