15.09.2010, 21:52
I know you are all probably getting annoyed with how much I post, but screw off. This is a discussion forum...
Anyways, I have the command /spawncar and I have tried to get it to where you can do /spawncar 411 0 0 and it spawns a black Infernus, but it doesn't. The car will spawn, but the color won't work. How do I fix the color problem?
Anyways, I have the command /spawncar and I have tried to get it to where you can do /spawncar 411 0 0 and it spawns a black Infernus, but it doesn't. The car will spawn, but the color won't work. How do I fix the color problem?
pawn Code:
command(spawncar, playerid, params[])
{
new carid, color1, color2, Float: CarToX, Float: CarToY, Float: CarToZ, car;
if( sscanf( params, "ddd", carid, color1, color2) )
{
if( PlayerStatistics[playerid][pAdminLevel] >= 3 )
{
SendClientMessage( playerid, COLOR_WHITE, "SYNTAX: /spawncar [modelid]" );
}
}
else
{
if( PlayerStatistics[playerid][pAdminLevel] >= 3)
{
if(carid < 400 || carid > 611)
{
SendClientMessage( playerid, COLOR_RED, "Wrong vehicle model ID! (400 - 600)" );
return 1;
}
GetPlayerPos( playerid, CarToX, CarToY, CarToZ);
car = CreateVehicle(carid, CarToX, CarToY+4, CarToZ, 90, -1, -1, -1);
ChangeVehicleColor(carid, color1, color2);
PutPlayerInVehicle(playerid, car, 0);
LinkVehicleToInterior(car, GetPlayerInterior(playerid ));
SetVehicleVirtualWorld(car, GetPlayerVirtualWorld(playerid));
}
}
return 1;
}