Add vehicle?
#1

Hey so what have i done wrong in this code?

Код:
public OnGameModeInit()
{
AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0,0,0,0,0)
 return 1;
}
Still saying 0 vehicles models loaded
number of: Vehcle models: 0

Why is this?
Reply
#2

Код:
AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0);
Where'd you get those 0's from?

https://sampwiki.blast.hk/wiki/AddStaticVehicle
Reply
#3

Plus add ; at the end of Addstatisvehicle function.
Reply
#4

https://sampwiki.blast.hk/wiki/AddStaticVehicle

Parameters:
pawn Код:
(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
You're adding 4 extra parameters, also not using > ; < at the end. It should be like this:

pawn Код:
public OnGameModeInit()
{
    AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0);
    return 1;
}
EDIT: I went to drink water while typing this answer, didn't see the other ones.
Reply
#5

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Код:
AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0)
Where'd you get those 0's from?

https://sampwiki.blast.hk/wiki/AddStaticVehicle
Yea i know but when u do a player class its
Код:
AddPlayerClass(0,2039.6019,1310.0482,10.6719,181.0950,0,0,0,0,0,0);
So it should be like this then?
Код:
AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0); //
SOZ i mean like:
Код:
public OnGameModeInit()
{

    AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0);

    return 1;
}
Reply
#6

Quote:
Originally Posted by CTR0X
Посмотреть сообщение
Yea i know but when u do a player class its
Код:
AddPlayerClass(0,2039.6019,1310.0482,10.6719,181.0950,0,0,0,0,0,0);
So it should be like this then?
Код:
AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0); //
Yes, because AddPlayerClass & AddStaticVehicle have different Parameters

https://sampwiki.blast.hk/wiki/AddPlayerClass
https://sampwiki.blast.hk/wiki/AddStaticVehicle

But when you're ingame and type /save in a vehicle it should provide the exact parameters for AddStaticVehicle.
Reply
#7

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Код:
AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0);
Where'd you get those 0's from?

https://sampwiki.blast.hk/wiki/AddStaticVehicle
Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Yes, because AddPlayerClass & AddStaticVehicle have different Parameters

https://sampwiki.blast.hk/wiki/AddPlayerClass
https://sampwiki.blast.hk/wiki/AddStaticVehicle

But when you're ingame and type /save in a vehicle it should provide the exact parameters for AddStaticVehicle.
Yea but i cant spawn vehcles in the game yet....
This is stupid cus it still doesnt come up with anything

Код:
public OnGameModeInit()
{

    AddStaticVehicle(451,2039.6019,1310.0482,10.6719,181.0950,0,0);
    return 1;
}
Reply
#8

Use This : https://sampwiki.blast.hk/wiki/CreateVehicle
Код:
public OnGameModeInit()
{
    // Add a Hydra (520) to the game with a respawn time of 60 seconds
    CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 60);
    return 1;
}
Код:
vehicletype	The model for the vehicle.
Float:X	The X coordinate for the vehicle.
Float:Y	The Y coordinate for the vehicle.
Float:Z	The Z coordinate for the vehicle.
Float:rotation	The facing angle for the vehicle.
color1	The primary color ID.
color2	The secondary color ID.
respawn_delay	The delay until the car is respawned without a driver in seconds. Using -1 will prevent the vehicle from respawning.
addsiren	Added in 0.3.7; will not work in earlier versions. Has a default value 0. Enables the vehicle to have a siren, providing the vehicle has a horn.
All Vehicles Created Will be respawned Respawn_delay Should Be +0 otherwise it won't respawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)