move vehicle functions to gta\vehicle_data.pwn

This commit is contained in:
Lorenc Pekaj 2018-10-10 19:03:48 +11:00
parent 17285c5251
commit 1252bb5d89
2 changed files with 68 additions and 67 deletions

View File

@ -42,6 +42,7 @@ stock const g_aVehicleNames[ 212 ] [ ] =
{ "Utility Trailer"}
};
/* ** Functions ** */
stock GetVehicleModelFromName( szVehicleName[ ] )
{
for( new i = 400; i <= 611; i++ )
@ -50,3 +51,67 @@ stock GetVehicleModelFromName( szVehicleName[ ] )
return -1;
}
stock IsBoatVehicle(value)
{
static const valid_values[6] = {
29425665, -2143286272, 0, 0, 0, 32
};
if (430 <= value <= 595) {
value -= 430;
return (valid_values[value >>> 5] & (1 << (value & 31))) || false;
}
return false;
}
stock IsAirVehicle(value)
{
static const valid_values[6] = {
1073742081, 135268352, -1073676096, 192, 262408, 98305
};
if (417 <= value <= 593) {
value -= 417;
return (valid_values[value >>> 5] & (1 << (value & 31))) || false;
}
return false;
}
stock IsBikeVehicle(value)
{
static const valid_values[5] = {
1105921, 1610612738, 1536, 0, 1056
};
if (448 <= value <= 586) {
value -= 448;
return (valid_values[value >>> 5] & (1 << (value & 31))) || false;
}
return false;
}
stock IsTrailerVehicle(model) {
static const valid_values[6] = {
32769, 0, 0, 0, 270532608, 112640
};
if (435 <= model <= 611) {
model -= 435;
return (valid_values[model >>> 5] & (1 << (model & 31))) || false;
}
return false;
}
stock IsLowriderVehicle(model)
{
static const valid_values[6] = {
1, 0, 0, 469762048, 201326592, 24
};
if (412 <= model <= 576) {
model -= 412;
return (valid_values[model >>> 5] & (1 << (model & 31))) || false;
}
return false;
}

View File

@ -13474,70 +13474,6 @@ public OnHelpHTTPResponse( index, response_code, data[ ] )
return 1;
}
stock IsBoatVehicle(value)
{
static const valid_values[6] = {
29425665, -2143286272, 0, 0, 0, 32
};
if (430 <= value <= 595) {
value -= 430;
return (valid_values[value >>> 5] & (1 << (value & 31))) || false;
}
return false;
}
stock IsAirVehicle(value)
{
static const valid_values[6] = {
1073742081, 135268352, -1073676096, 192, 262408, 98305
};
if (417 <= value <= 593) {
value -= 417;
return (valid_values[value >>> 5] & (1 << (value & 31))) || false;
}
return false;
}
stock IsBikeVehicle(value)
{
static const valid_values[5] = {
1105921, 1610612738, 1536, 0, 1056
};
if (448 <= value <= 586) {
value -= 448;
return (valid_values[value >>> 5] & (1 << (value & 31))) || false;
}
return false;
}
stock IsTrailerVehicle(model) {
static const valid_values[6] = {
32769, 0, 0, 0, 270532608, 112640
};
if (435 <= model <= 611) {
model -= 435;
return (valid_values[model >>> 5] & (1 << (model & 31))) || false;
}
return false;
}
stock IsLowriderVehicle(model)
{
static const valid_values[6] = {
1, 0, 0, 469762048, 201326592, 24
};
if (412 <= model <= 576) {
model -= 412;
return (valid_values[model >>> 5] & (1 << (model & 31))) || false;
}
return false;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
@ -14358,9 +14294,9 @@ stock SetPlayerColorToTeam( playerid )
default_color = COLOR_DEFAULT;
// set color according to wanted level
if ( p_WantedLevel[ playerid ] > 11 ) default_color = COLOR_WANTED12;
else if ( p_WantedLevel[ playerid ] > 5 ) default_color = COLOR_WANTED6;
else if ( p_WantedLevel[ playerid ] > 1 ) default_color = COLOR_WANTED2;
if ( p_WantedLevel[ playerid ] >= 12 ) default_color = COLOR_WANTED12;
else if ( p_WantedLevel[ playerid ] >= 6 ) default_color = COLOR_WANTED6;
else if ( p_WantedLevel[ playerid ] >= 1 ) default_color = COLOR_WANTED2;
else if ( p_GangID[ playerid ] != INVALID_GANG_ID ) default_color = g_gangData[ p_GangID[ playerid ] ] [ E_COLOR ];
// set alpha for invisible players to 0