SA-MP Forums Archive
Command doesn't seem to work. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command doesn't seem to work. (/showthread.php?tid=583748)



Command doesn't seem to work. - ounce - 30.07.2015

Okay, so whenever I do this, /v putpackage, it returns me a command to use but the command doesn't exist, so instead I just try to /v putpackage 1 to place my weapon package slot 1 inside the vehicle. Anyone able to help me out? I need help for /v putpackage so this command is able to place a package inside, because it doesn't seem to work.

pawn Код:
if(!strcmp(option, "putpackage", true))
    {
        new id = GetNearestVehicle(playerid), slotid;
        if (sscanf(params, "d", slotid)) return SyntaxMSG(playerid, "/storepackage [slotid]");
        if (id == INVALID_VEHICLE_ID) return SCM(playerid, COLOR_INFO, "You are not near any vehicle.");
        if (PlayerInfo[playerid][pCarKey] != id) return SCM(playerid, COLOR_INFO, "You don't own this vehicle.");
        if (slotid < 1 || slotid > 10) return SCM(playerid, COLOR_LIGHTRED, "Error: The package slot must be between 1 and 10.");
        if (!PlayerInfo[playerid][pGunPackages][slotid-1]) return SCM(playerid, COLOR_LIGHTRED, "Error: There is no package in this slot.");

        for (new i = 0; i < 10; i ++)
        {
            if (!VehicleInfo[id][carPackages][slotid-1])
            {
                VehicleInfo[id][carPackages][slotid-1] = PlayerInfo[playerid][pGunPackages][slotid-1];
                VehicleInfo[id][carPackageAmmo][slotid-1] = PlayerInfo[playerid][pPackageAmmo][slotid-1];

                SCMEx(playerid, COLOR_GREEN, "* You have stored a %s with %d ammo into this vehicle.", GetPackageType(PlayerInfo[playerid][pGunPackages][slotid-1]), PlayerInfo[playerid][pPackageAmmo][slotid-1]);
                SaveVehicle(id);
                return 1;
            }
        }
        SCM(playerid, COLOR_INFO, "There is no room in the vehicle.");
        return 1;
    }



Re: Command doesn't seem to work. - ounce - 31.07.2015

Fixed it.