CMD:pcb problem
#1

Okay, so I have a problem with my command
its for Hitman Faction
It plants a car bomb but I had to redesign it again for the 3rd time due to minor ig bugs
What is happening right now is it wont even compile, throwing error for mysql, but there is no problem with mysql XD

pawn Код:
CMD:pcb(playerid, params[])//Edited by NinjahZ
{
    new closestcar = GetClosestCar(playerid, GetPlayerVehicleID(playerid));
    new vehicleid = GetPlayerVehicleID(playerid);
    vehicleid = GetPlayerVehicleID(playerid);
    new stringhmpcb[246];
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(IsAHitman(playerid))
    {
        if(!PlayerInfo[playerid][pBombs])//If the Hitman can not aquire a bomb RANK defined maybe
        {
            SendClientMessage(playerid, COLOR_GRAD2, "You do no have access to using such items right now!");
        }
        if(engine == VEHICLE_PARAMS_ON) //If the Hit's car Engine is on
        {
            if(IsPlayerInAnyVehicle(playerid))// and the Hitman is in the car
            {
                SendClientMessage(playerid, -1, "You need to exit the vehicle before planting a C4!");
            }
        }
        if(engine == VEHICLE_PARAMS_OFF)//If the Hit's car Engine is off
        {
            if(IsPlayerInAnyVehicle(playerid))// and the Hitman is in the car
            {
                SendClientMessage(playerid, -1, "You need to exit the vehicle before planting a C4!");
            }
        }
        if(VehicleBomb{closestcar})//If there is a Bomb on the closest Vehicle already.
        {
            SendClientMessage(playerid, COLOR_GRAD2, "There is already C4 on the vehicle engine!");
        }
        if(!PlayerInfo[playerid][pC4])//If the Hitman has less than 1 C4
        {
            SendClientMessage(playerid, COLOR_GRAD2, " You do not have any C4!");
        }
        if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 3.0) || closestcar == INVALID_VEHICLE_ID)//If the Hitman is not in range of the car
        {
            SendClientMessage(playerid, COLOR_GRAD2, "You're not close enough to any vehicle!");
        }
        else if(!VehicleBomb{closestcar})//If there isnt a Bomb on the closest Vehicle.
        {
        if(PlayerInfo[playerid][pC4])//and if the Hitman does have more than 0 C4
        {
            if(engine == VEHICLE_PARAMS_ON) //And if the Hit's car Engine is on
            {
                if(IsPlayerInAnyVehicle(playerid))// and the Hitman is in the car
                {
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    format(stringhmpcb, sizeof(stringhmpcb), "{FF8000}** {C2A2DA}%s has pulled the car battery out while they are rewiring the ignition leads.", GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, stringhmpcb, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(!IsPlayerInAnyVehicle(playerid))//Else if the Hitman is not in the Vehicle
                {
                    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    format(stringhmpcb, sizeof(stringhmpcb), "{FF8000}** {C2A2DA}%s has started rewiring the ignition leads.", GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, stringhmpcb, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(engine == VEHICLE_PARAMS_OFF)//else If the Hit's car Engine is off
            {
                if(IsPlayerInAnyVehicle(playerid))// and the Hitman is in the car
                {
                    format(stringhmpcb, sizeof(stringhmpcb), "{FF8000}** {C2A2DA}%s has pulled the car battery out while they are rewiring the ignition leads.", GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, stringhmpcb, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(!IsPlayerInAnyVehicle(playerid))//If the Hitman is not in the Vehicle
                {
                    format(stringhmpcb, sizeof(stringhmpcb), "{FF8000}** {C2A2DA}%s has started rewiring the ignition leads.", GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, stringhmpcb, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0) || closestcar == INVALID_VEHICLE_ID)//And if the Hitman is in range of the car
            {
                if(PlayerInfo[playerid][pBombs])//If the Hitman has access to aquire a bomb RANK defined maybe
                {
                    VehicleBomb{closestcar} = 1;
                    PlacedVehicleBomb[playerid] = closestcar;
                    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                    SendClientMessage(playerid, -1, "You have placed C4 on the vehicle engine, /pickupbomb to remove it.");
                    PlayerInfo[playerid][pC4] = 1;
                    PlayerInfo[playerid][pBombs]--;
                    PlayerInfo[playerid][pC4Used] = 2;
                }
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD2, "You are not a member of the Hitman Agency !");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)