Sirens attach object dosent work
#2

pawn Код:
COMMAND:sirenson2(playerid, params[])
{
    new VehModel; //Okay you created a new varialbe to hold the VehModel, but it's not set to anything, so it's 0
    if(GetVehicleModel(VehModel) == 460) //Hold on? We're checking the vehicle model of VehModel which is 0?
    {
        new VehID; //Okay we're making a new variable for the vehicle id
        VehID = GetPlayerVehicleID(playerid); //Storing it
        GetPlayerVehicleID(playerid); //Why are we calling it twice?
        AttachObjectToVehicle(obj1, VehID, -5.025067, 0.389999, 1.184999, -2.010001, 0.000000, 0.000000);
        AttachObjectToVehicle(obj2, VehID, 4.600057, 0.374999, 1.164999, 0.000000, 0.000000, 0.000000);
        AttachObjectToVehicle(obj3, VehID, 0.000000, 2.365006, 0.559999, 0.000000, 0.000000, 0.000000);
        SendClientMessage(playerid, COLOR_BLUE, "I don't get this message.");
    }
    return 1;
}
Fixed:

pawn Код:
COMMAND:sirenson2(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_BLUE, "You need to be in a vehicle to use that command!"); //Send a error message if they're not in a vehicle
    else //Else they are
    {  
        new VehID = GetPlayerVehicleID(playerid); //Get the vehicleid of the vehicle they're driving
        if(GetVehicleModel(VehID) == 460) //If the vehicleid's model is 460
        {
            AttachObjectToVehicle(obj1, VehID, -5.025067, 0.389999, 1.184999, -2.010001, 0.000000, 0.000000);
            AttachObjectToVehicle(obj2, VehID, 4.600057, 0.374999, 1.164999, 0.000000, 0.000000, 0.000000);
            AttachObjectToVehicle(obj3, VehID, 0.000000, 2.365006, 0.559999, 0.000000, 0.000000, 0.000000);
            SendClientMessage(playerid, COLOR_BLUE, "I don't get this message.");          
        }  
    }
    return 1;
}
Reply


Messages In This Thread
Sirens attach object dosent work - by gnoomen2 - 10.02.2013, 14:11
Re: Sirens attach object dosent work - by Bicentric - 10.02.2013, 14:26
Re: Sirens attach object dosent work - by ryansheilds - 10.02.2013, 14:26
Re: Sirens attach object dosent work - by gnoomen2 - 10.02.2013, 14:33
Re: Sirens attach object dosent work - by ryansheilds - 10.02.2013, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)