This works in another script but not mine?
#9

pawn Код:
CMD:trunk(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    new item[32], amount,usage[24], vehicleid = GetClosestVehicle(playerid, 3);
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_GREY, "You must get out of the vehicle to use this.");
    if(VehWep1[vehicleid] > 0 && VehWep2[vehicleid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You do not have any free weapon slots.");
    if(sscanf(params, "s[32]",usage))
    {
        printf("USAGE: %s", usage);
        SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk [usage]");
        SendClientMessage(playerid, COLOUR_GREY, "Usages: Store, Get, View");
        return 1;
    }
    VehicleSQLID[vehicleid] = MySQL_GetValue(VehicleSQLID[vehicleid], "id", "vehicles");
    if(vehicleid == TrunkOpened[playerid])
    {
        if(!strcmp(usage, "store", true))
        {
            printf("USAGE: %s", usage);
            if(sscanf(usage, "s[24]",item))
            {
                printf("USAGE: %s", usage);
                printf("ITEM: %s", item);
                SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store [item]");
                SendClientMessage(playerid, COLOUR_GREY, "Available Items: Weapon, Weed, Cocaine, Money, Armour");
            }

            if(!(strcmp(item, "weapon", true)))
            {
                new weapon = GetPlayerWeapon(playerid);
                new ammo = GetPlayerAmmo(playerid);
                new string[128];
                if(weapon > 1)
                {
                if(VehWep1[vehicleid] == 0)
                {
                    VehWep1[vehicleid] = weapon;
                    VehWepA1[vehicleid] = ammo;
                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehWep1", weapon, "vehicles");
                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehWepA1", ammo, "vehicles");
                    RemovePlayerWeapon(playerid, weapon);
                    format(string, sizeof(string), "You have stored a %s in your vehicles trunk.", WeaponNames[weapon]);
                    SendClientMessage(playerid, COLOUR_BLUE, string);
                    format(string, sizeof(string), "* %s has stored a weapon in the %s's trunk.", GetNameEx(playerid), VehicleNames[vehicleid]);
                    ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);

                }
                else if(VehWep2[vehicleid] == 0)
                {
                    VehWep2[vehicleid] = weapon;
                    VehWepA2[vehicleid] = ammo;
                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehWep2", weapon, "vehicles");
                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehWepA2", ammo, "vehicles");
                    RemovePlayerWeapon(playerid, weapon);
                    format(string, sizeof(string), "You have stored a %s in your vehicles trunk.", WeaponNames[weapon]);
                    SendClientMessage(playerid, COLOUR_BLUE, string);
                    format(string, sizeof(string), "* %s has stored a weapon in the %s's trunk.", GetNameEx(playerid), VehicleNames[vehicleid]);
                    ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                    }

                }

            }
        }
    }
    return 1;
}
I've posted some prints....it shows... USAGE: (NOTHING HERE) for the first one?!
[15:33:37] USAGE: - Command executed here.
[15:33:13] Admin Connected: Grant McCaw, Count: 1
[15:33:08] Number of vehicle models: 4
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)