16.09.2012, 16:03
I'm trying to make command for enter in at 400s
But it dosen't work im near empty at400s and when i use /at400s nothing happen.
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);
}