can i set car id?
#1

Can I set a ID for a car?
to this i mean
example setting this car ID 1000
pawn Код:
AddStaticVehicleEx(598,2779.3843,-2434.2644,13.3568,88.5203,99,1,30000);
Reply
#2

* I still didn't get you exactly,
like maybe:

pawn Код:
new car1;
Under OnPlayerGameModeInIt

pawn Код:
car1 = AddStaticVehicleEx(598,2779.3843,-2434.2644,13.3568,88.5203,99,1,30000);
Reply
#3

TL;DR
No.


IDs are set to vehicles according to their count on your server, if you call the function you provided 999 times before this, then the last one called will be id 1000. Also note SAMP's limits.
Reply
#4

ik that...
but i mean i can set?
Reply
#5

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
TL;DR
No.
Means you can? Seriously?
Reply
#6

Why would you want to do this anyways, seems useless to me.
Reply
#7

Becuase in raven's RP vehicle system bugged at all...
I will make faction cars id 1500+ so owned vehicles won't be bugged
Reply
#8

Technically you can by temporally creating many vehicles so the real vehicle takes the last ID. This is unefficient and you should never do it; instead, fix Raven's RP vehicle system. The function is here (it requires you to define IsValidVehicle):
PHP код:
native IsValidVehicle(vehicleid);
CreateVehicleAtId(idmodelidFloat:xFloat:yFloat:zFloat:anglecolor1color2respawn_delay)
{
    if(
IsValidVehicle(id) || !id) return 0;
    new 
tempId[MAX_VEHICLES], boolisTemp[MAX_VEHICLES] = falsefinalId;
    for(new 
0!= ida++)
    {
        if(!
IsValidVehicle(a))
        {
            
isTemp[a] = true;
            
tempId[a] = CreateVehicle(4000.00.00.00.0111);
        }
    }
    
finalId CreateVehicle(modelidxyzanglecolor1color2respawn_delay);
    for(new 
0!= ida++)
    {
        if(
isTemp[a] == false) continue;
        
DestroyVehicle(a);
    }
    return 
finalId;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)