Replacement for this?
#4

Quote:
Originally Posted by Rajat_Pawar
View Post
pawn Code:
stock IsPlayerInRangeOfVehicle(playerid, veh, Float: range)
{
    if( !IsPlayerConnected(playerid) ) return 0 ;
   
    if( IsValidVehicle( veh ) )
    {
         new Float: x,
                Float: y,
                Float: z;
          GetVehiclePos( veh, x, y, z );
         
           if( IsPlayerInRangeOfPoint( playerid, range, x, y, z ) ) return true;
           else
                return false;
      }
}
This stock?
The IsValidVehicle will be undefined. You need to declare the native:
pawn Code:
#include <a_samp>
// some other includes..

native IsValidVehicle( vehicleid );
Plus, the function should return a value at the end.

EDIT:
pawn Code:
stock IsPlayerInRangeOfVehicle(playerid, veh, Float: range)
{
    if( !IsPlayerConnected( playerid ) ) return 0;
    if( !IsValidVehicle( veh ) ) return 0;
   
    new Float: x,
        Float: y,
        Float: z
    ;
    GetVehiclePos( veh, x, y, z );

    if( IsPlayerInRangeOfPoint( playerid, range, x, y, z ) ) return 1;
    return 0;
}
Reply


Messages In This Thread
Replacement for this? - by CrossWindGaming - 26.09.2013, 08:23
Re: Replacement for this? - by iZN - 26.09.2013, 08:27
Re: Replacement for this? - by RajatPawar - 26.09.2013, 08:37
Re: Replacement for this? - by Konstantinos - 26.09.2013, 10:10

Forum Jump:


Users browsing this thread: 1 Guest(s)