In this way, I can get into all rc vehicles except the tram...
Why??????
Why??????
PHP Code:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <cuffs>
#define RC_ENTER_RANGE 8
new RCVehicles[] = {
441,
464,
465,
501,
564,
594,
449
};
main()
{
print("\n----------------------------------");
print(" By Crystal94");
print("----------------------------------\n");
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & 16)
{
new Float:x,Float:y,Float:z;
if(IsPlayerInAnyVehicle(playerid) && IsVehicleRCVehicle(GetPlayerVehicleID(playerid)))
{
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
SetPlayerPos(playerid,x,y,z+1.8);
return 1;
}
for(new v; v < MAX_VEHICLES; v++)
{
GetVehiclePos(v,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,RC_ENTER_RANGE,x,y,z) && IsVehicleRCVehicle(v))
{
PutPlayerInVehicle(playerid,v,0);
return 1;
}
}
}
return 1;
}
stock IsVehicleRCVehicle(vehicleid)
{
for(new v; v < 6; v++)
{
if(GetVehicleModel(vehicleid) == RCVehicles[v]) return 1;
}
return 0;
}