new Trailers[3][1] =
{
403,
514,
515,
};
CMD:trailer(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsATruck(vehicleid))
{
new randtrailer = random( sizeof( Trailers ) );
AttachTrailerToVehicle(randtrailer, IsATruck(vehicleid));
SendClientMessage(playerid, COLOR_RED, "INFO: Trailer attached");
printf("%d", randtrailer);
}
return 1;
}
stock IsATruck(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 435, 450, 584, 591: return 1;
}
return 1;
}
AttachTrailerToVehicle(randtrailer, IsATruck(vehicleid));
AttachTrailerToVehicle(randtrailer, vehicleid);
CMD:trailer(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsATruck(vehicleid))
{
new randtrailer = random( sizeof( Trailers ) );
AttachTrailerToVehicle(randtrailer, vehicleid);
SendClientMessage(playerid, COLOR_RED, "INFO: Trailer attached");
printf("%d", randtrailer);
}
return 1;
}
stock IsATruck(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 435, 450, 584, 591: return 1;
}
return 1;
}
It still doesn't want to work, it maybe because of the way I am setting the trailers on the top code.
|
AttachTrailerToVehicle(450, vehicleid);
CMD:trailer(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsATruck(vehicleid))
{
new randtrailer = random( sizeof( Trailers ) );
AttachTrailerToVehicle(randtrailer, vehicleid);
SendClientMessage(playerid, COLOR_RED, "INFO: Trailer attached");
printf("%d", randtrailer);
}
return 1;
}
stock IsATruck(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 403, 514, 515: return 1;
}
return 1;
}