Trunk System for Cops bugged
#1

C:\Users\Alex\Desktop\Servers\Samp\IBS\gamemodes\I BS.pwn(13313 -- 13346) : warning 209: function "cmd_coptrunk" should return a value
C:\Users\Alex\Desktop\Servers\Samp\IBS\gamemodes\I BS.pwn(13313 -- 13348 ) : error 010: invalid function or declaration


pawn Код:
CMD:coptrunk(playerid, params[])
{
    new string[128], done, idx;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    {
        new Float:vx, Float:vy, Float:vz;
        new car = GetClosestVehicle(playerid);
        //new car = GetPlayerVehicleID(playerid);
        //if(car <= 0 || GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
        if(car <= 0 || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT || DistanceBetweenPlayerAndVeh(playerid, car) > 5.0)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "   You aren't near any vehicle!");
            return 1;
        }
            idx = car;
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
            if(!boot)
            {

                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 1, objective);
                format(string, sizeof(string), "* %s opens their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Trunk Opened", 3500, 3);
                topened[playerid] = 1;
            }
            else
            {
                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 0, objective);
                format(string, sizeof(string), "* %s closes their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Trunk Closed", 3500, 3);
                topened[playerid] = 0;
            }
        }
    }

    return 1;
}
Reply
#2

try

pawn Код:
CMD:coptrunk(playerid, params[])
{
    new string[128], done, idx;
    if( IsPlayerLoggedIn(playerid))
    {
        new Float:vx, Float:vy, Float:vz;
        new car = GetClosestVehicle(playerid);
        //new car = GetPlayerVehicleID(playerid);
        //if(car <= 0 || GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
       
        if(car <= 0 || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT || DistanceBetweenPlayerAndVeh(playerid, car) > 5.0) return
        SendClientMessage(playerid, COLOR_LIGHTRED, "   You aren't near any vehicle!");

            idx = car;
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
            if(!boot)
            {

                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 1, objective);
                format(string, sizeof(string), "* %s opens their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Trunk Opened", 3500, 3);
                topened[playerid] = 1;
            }
            else
            {
                SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 0, objective);
                format(string, sizeof(string), "* %s closes their vehicle's trunk.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Trunk Closed", 3500, 3);
                topened[playerid] = 0;
            }
    }
    else return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)