vendredi 31 juillet 2015

Trunk command, issues with storing, might be to do with misplaced bracket.

Code:

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],usage[24], string[128], slot;
        new vehicleid = GetClosestVehicle(playerid);
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(boot == 0) return SendClientMessage(playerid, COLOUR_GREY, "You are not accessing any trunk.");
        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_GREY, "You must get out of the vehicle to use this.");
        if(VehicleSQLID[vehicleid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You cannot use this vehicle's trunk. (Admin Spawned/Static).");
        if(sscanf(params, "s[24]S(0)[32]D(0)",usage,item, slot))
        {
                SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk [usage]");
                SendClientMessage(playerid, COLOUR_GREY, "Usages: Store, Get, View, Weapons");
                return 1;//ok take me back to the place that's not working
        }

        if(IsPlayerInRangeOfVehicle(playerid, vehicleid,5))
        {
            if(!strcmp(usage, "store", true))
            {
                      if(sscanf(params, "s[24]s[32]",usage,item))
                        {
                              SendClientMessage(playerid, COLOUR_GREY, "Usage:/trunk store [item]");
                            SendClientMessage(playerid, COLOUR_GREY, "Available Items: Weed, Cocaine, Money, Armour");
                            return 1;

                        }
                        if(!strcmp(item, "weed", true))
                        {
                                  if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store weed [amount]");
                                    return 1;

                                }
                            if(slot > Weed[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much weed.");
                                VehWeed[vehicleid] += slot;
                                Weed[playerid] -= slot;
                                format(string, sizeof(string), "You have stored a %d gram(s) of weed in your vehicle's trunk.", slot);
                                SendClientMessage(playerid, COLOUR_BLUE, string);
                                format(string, sizeof(string), "* %s has stored some drugs in the vehicle's trunk *", GetNameEx(playerid));
                                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                        if(!strcmp(item, "cocaine", true))
                        {
                                  if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store cocaine [amount]");
                                    return 1;

                                }
                            if(slot > Cocaine[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much cocaine.");
                                VehCoke[vehicleid] += slot;
                                Cocaine[playerid] -= slot;
                                if(VehicleSQLID[vehicleid] > 0)
                                {
                                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehCoke", VehCoke[vehicleid], "vehicles");
                                    MySQL_SetInteger(PlayerSQLID[playerid], "Cocaine", Cocaine[playerid], "accounts");
                                }
                                format(string, sizeof(string), "You have stored a %d gram(s) of cocaine in the vehicle's trunk.", slot);
                                SendClientMessage(playerid, COLOUR_BLUE, string);
                                format(string, sizeof(string), "* %s has stored some drugs in the vehicle's trunk. *", GetNameEx(playerid));
                                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                        if(!strcmp(item, "money", true))
                        {
                                  if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store money [amount]");
                                    return 1;
                                    printf("MONEY AMOUNT CLEARED SSCANF");
                                    printf("VEH ID %d", vehicleid);
                                }
                                printf("VEH ID %d", vehicleid);
                            if(slot > PlayerMoney[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                            if(slot < 1 || slot  > 100000) return SendClientMessage(playerid, COLOUR_GREY, "The amount must be between $0 and $100,000");
                                VehCash[vehicleid] += slot;
                                PlayerMoney[playerid] -= slot;
                                GivePlayerMoney(playerid, -slot);
                                if(VehicleSQLID[vehicleid] > 0)
                                {
                                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehCash", VehCash[vehicleid], "vehicles");
                                    MySQL_SetInteger(PlayerSQLID[playerid], "Money", PlayerMoney[playerid], "accounts");
                                }
                                format(string, sizeof(string), "You have stored $%s in the vehicle, there is now a total of $%s in the vehicle's trunk.", AddCommas(slot), AddCommas(VehCash[vehicleid]));
                                SendClientMessage(playerid, COLOUR_BLUE, string);
                                format(string, sizeof(string), "* %s has stored some money in the vehicle's trunk *", GetNameEx(playerid));

                                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                        if(!strcmp(item, "armour", true))
                        {
                            GetPlayerArmour(playerid, PlayerArmour[playerid]);
                                new Float: armour;
                            if(sscanf(params, "s[24]s[32]f",usage,item,armour))
                            {
                                SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store armour [amount]");
                                return 1;
                            }

                            if(armour < 1 || armour > 100)return SendClientMessage(playerid, COLOUR_GREY, "Amount must be between 0 and 100");
                            if(armour > PlayerArmour[playerid])return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much armour");

                            VehArmour[vehicleid] += armour;
                            PlayerArmour[playerid] -= armour;
                            SetPlayerArmour(playerid, -armour);
                                if(VehicleSQLID[vehicleid] > 0)
                                {
                                    MySQL_SetFloat(vehicleid, "VehArmour", VehArmour[vehicleid], "vehicles");
                                    MySQL_SetFloat(PlayerSQLID[playerid], "Armour", PlayerArmour[playerid], "accounts");
                                }

                            format(string, sizeof(string), "You have stored %d of armour, there is now a total of: %d armour in the vehicle's trunk.", floatround(armour), floatround(VehArmour[vehicleid]));
                            SendClientMessage(playerid, COLOUR_BLUE, string);
                            format(string, sizeof(string), "* %s has stored some armour in the vehicle's trunk. *", GetNameEx(playerid));
                            ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                }//close store
                if(!strcmp(usage, "get", true))
                          {
                                if(sscanf(params, "s[24]s[32]D(0)",usage,item, slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk get [item]");
                                    SendClientMessage(playerid, COLOUR_GREY, "Available Items: Weed, Cocaine, Money, Armour");
                                    return 1;

                                }
                                if(!strcmp(item, "weed", true))
                                {
                                        if(VehicleSQLID[vehicleid] > 0)
                                        {
                                                VehWeed[vehicleid] = MySQL_GetValue(VehicleSQLID[vehicleid], "VehWeed", "vehicles");
                                            Weed[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "weed", "accounts");
                                        }
                                          if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                        {
                                              SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk get weed [amount]");

                                            return 1;

                                        }
                                    if(slot > VehWeed[vehicleid]) return SendClientMessage(playerid, COLOUR_GREY, "There is not this much weed stored in the vehicle.");
                                        VehWeed[vehicleid] -= slot;
                                        Weed[playerid] += slot;
                                        if(VehicleSQLID[vehicleid] > 0)
                                        {
                                            MySQL_SetInteger(VehicleSQLID[vehicleid], "VehWeed", VehWeed[vehicleid], "vehicles");
                                            MySQL_SetInteger(PlayerSQLID[playerid], "Weed", Weed[playerid], "accounts");
                                        }
                                        format(string, sizeof(string), "You have taken %d gram(s) of weed from the vehicle's trunk.", slot);
                                        SendClientMessage(playerid, COLOUR_BLUE, string);
                                        format(string, sizeof(string), "* %s has taken some drugs from the vehicle's trunk. *", GetNameEx(playerid));
                                        ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                                }
                                  if(!strcmp(item, "cocaine", true))
                                {
                                        if(VehicleSQLID[vehicleid] > 0)
                                        {
                                                        VehCoke[vehicleid] = MySQL_GetValue(VehicleSQLID[vehicleid], "VehCoke", "vehicles");
                                                    Cocaine[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Cocaine", "accounts");
                                        }
                                          if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                        {
                                              SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk get cocaine [amount]");
                                            return 1;

                                        }
                                    if(slot > VehCoke[vehicleid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much cocaine.");
                                        VehCoke[vehicleid] -= slot;
                                        Cocaine[playerid] += slot;
                                        if(VehicleSQLID[vehicleid] > 0)
                                        {
                                            MySQL_SetInteger(VehicleSQLID[vehicleid], "VehCoke", VehCoke[vehicleid], "vehicles");
                                            MySQL_SetInteger(PlayerSQLID[playerid], "Cocaine", Cocaine[playerid], "accounts");
                                        }
                                        format(string, sizeof(string), "You have taken %d gram(s) of cocaine from the vehicle's trunk.", slot);
                                        SendClientMessage(playerid, COLOUR_BLUE, string);
                                        format(string, sizeof(string), "* %s has taken some drugs from the vehicle's trunk. *", GetNameEx(playerid));
                                        ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                                }
                                  if(!strcmp(item, "money", true))
                                {
                                          if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                        {
                                              SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk get money [amount]");
                                            return 1;

                                        }
                                    if(VehCash[vehicleid] < slot) return SendClientMessage(playerid, COLOUR_GREY, "There is not this much money stored in the vehicle.");
                                    if(slot < 1 || slot  > 100000) return SendClientMessage(playerid, COLOUR_GREY, "The amount must be between $0 and $100,000");
                                        VehCash[vehicleid] -= slot;
                                        PlayerMoney[playerid] += slot;
                                        GivePlayerMoney(playerid, slot);
                                        if(VehicleSQLID[vehicleid] > 0)
                                        {
                                            MySQL_SetInteger(VehicleSQLID[vehicleid], "VehCash", VehCash[vehicleid], "vehicles");
                                            MySQL_SetInteger(PlayerSQLID[playerid], "Money", PlayerMoney[playerid], "accounts");
                                        }
                                        format(string, sizeof(string), "You have taken $%s from the vehicle, there is now a total of: $%s in the vehicle's trunk.", AddCommas(slot), AddCommas(VehCash[vehicleid]));
                                        SendClientMessage(playerid, COLOUR_BLUE, string);
                                        format(string, sizeof(string), "* %s has taken some money from the vehicle's trunk. *", GetNameEx(playerid));
                                        ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                                }
                                if(!strcmp(item, "armour", true))
                                {
                                    new Float: armour;
                                          if(sscanf(params, "s[24]s[32]f",usage,item,armour))
                                        {
                                              SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk get armour [amount]");
                                            return 1;

                                        }
                                    if(armour > VehArmour[vehicleid]) return SendClientMessage(playerid, COLOUR_GREY, "There is not this much armour stored in the vehicle.");
                                    if(PlayerArmour[playerid] + armour > 100) return SendClientMessage(playerid, COLOUR_GREY, "You may only have a maximum of 100 armour.");
                                        VehArmour[vehicleid] -= armour;
                                        PlayerArmour[playerid] += armour;
                                        SetPlayerArmour(playerid, PlayerArmour[playerid]);
                                        if(VehicleSQLID[vehicleid] > 0)
                                        {
                                            MySQL_SetFloat(vehicleid, "VehArmour", VehArmour[vehicleid], "vehicles");
                                            MySQL_SetFloat(PlayerSQLID[playerid], "Armour", PlayerArmour[playerid], "accounts");
                                        }
                                        format(string, sizeof(string), "You have taken %d of armour from the vehicle's trunk, there is now a total of: %d armour in the vehicle's trunk.", armour, floatround(VehArmour[vehicleid]));
                                        SendClientMessage(playerid, COLOUR_BLUE, string);
                                        format(string, sizeof(string), "* %s has taken some armour from the vehicle's trunk. *", GetNameEx(playerid));
                                        ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                                }
                }
        if(!strcmp(usage, "view", true))
        {
                                new weaponamount, furniamount;
                              for(new x = 1; x < MAX_WEAPONS; x++)
                                {
                                    if(VehWepStored[x] == VehicleSQLID[vehicleid])
                                    {
                                                weaponamount ++;
                                        }
                                        if(VehFurniStored[x] == VehicleSQLID[vehicleid])
                                        {
                                                furniamount ++;
                                        }
                                }
                              //0xBCDE00FF
                              //0x43B0FFFF
                              SendClientMessage(playerid,0xFFD99FFF, "____________________Vehicle Trunk____________________");
                              format(string, sizeof(string), "Money: {B0FFFF}$%s", AddCommas(VehCash[vehicleid]));
                              SendClientMessage(playerid, 0xFFD99FFF, string);
                              format(string, sizeof(string), "Armour: {B0FFFF}%d", floatround(VehArmour[vehicleid]));
                                SendClientMessage(playerid, 0xFFD99FFF, string);
                                format(string, sizeof(string), "Cocaine: {B0FFFF}%d gram(s)", VehCoke[vehicleid]);
                                SendClientMessage(playerid, 0xFFD99FFF, string);
                                format(string, sizeof(string), "Weed: {B0FFFF}%d gram(s)", VehWeed[vehicleid]);
                                SendClientMessage(playerid, 0xFFD99FFF, string);
                                format(string, sizeof(string), "Amount of weapons: {B0FFFF}%d. (Use /vgetwep to see what weapons are in the vehicle.)", weaponamount);
                                SendClientMessage(playerid, 0xFFD99FFF, string);
                                format(string, sizeof(string), "Amount of furniture: {B0FFFF}%d. (Use /vgetfurni to see what furniture is in the vehicle.)", furniamount);
                                SendClientMessage(playerid, 0xFFD99FFF, string);
                                SendClientMessage(playerid,0xFFD99FFF, "____________________Vehicle Trunk____________________");
                }
                  if(!strcmp(usage, "weapons", true))
            {
                            new amount = 0, string1[500], model = GetVehicleModel(vehicleid) - 400;
                                for(new x = 1; x < MAX_WEAPONS; x++)
                                {
                                    if(VehWepStored[x] == VehicleSQLID[vehicleid])
                                    {
                                                WeaponEnum[playerid][amount][wepid] = x;
                                        if(amount == 0 && WepSerial[x] == 0)
                                        {
                                                        format(string1, sizeof(string1),"%s (%d Ammo) Serial: None.",WeaponNames[WepModel[x]], WepAmmo[x]);
                                                }
                                                  if(amount == 0 && WepSerial[x] > 0)
                                        {
                                                        format(string1, sizeof(string1),"%s (%d Ammo) Serial: %d",WeaponNames[WepModel[x]], WepAmmo[x], WepSerial[x]);
                                                }
                                                if(amount > 0)
                                                {
                                                    if(WepSerial[x] > 0)
                                                    {
                                                                format(string1, sizeof(string1),"%s\n%s (%d Ammo) Serial: %d",string1, WeaponNames[WepModel[x]], WepAmmo[x], WepSerial[x]);
                                                        }
                                                        else
                                                        {
                                                                format(string1, sizeof(string1),"%s\n%s (%d Ammo) Serial: None.",string1, WeaponNames[WepModel[x]], WepAmmo[x]);
                                                        }

                                                }
                                                amount++;
                                                strcpy(Pdialogstring[playerid], string1, 500);
                                        }
                                }
                                        if(amount == 0) return SendClientMessage(playerid, COLOUR_GREY, "There are no weapons in this vehicle.");
                                        format(string, sizeof(string), "%s Weapons", VehicleNames[model]);
                                        ShowPlayerDialog(playerid, DIALOG_SHOWWEP, DIALOG_STYLE_LIST, string, Pdialogstring[playerid],"Close", "");
                }
        }
        return 1;
}


I realise this is a lot to look at but everything works except storing, I can get items from the vehicle but cannot store them. I can't see any misplaced brackets and the code isn't incorrect and I've tried to printf at some areas and they don't return.


STORE AREA.
Code:

            if(!strcmp(usage, "store", true))
            {
                      if(sscanf(params, "s[24]s[32]",usage,item))
                        {
                              SendClientMessage(playerid, COLOUR_GREY, "Usage:/trunk store [item]");
                            SendClientMessage(playerid, COLOUR_GREY, "Available Items: Weed, Cocaine, Money, Armour");
                            return 1;

                        }
                        if(!strcmp(item, "weed", true))
                        {
                                  if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store weed [amount]");
                                    return 1;

                                }
                            if(slot > Weed[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much weed.");
                                VehWeed[vehicleid] += slot;
                                Weed[playerid] -= slot;
                                format(string, sizeof(string), "You have stored a %d gram(s) of weed in your vehicle's trunk.", slot);
                                SendClientMessage(playerid, COLOUR_BLUE, string);
                                format(string, sizeof(string), "* %s has stored some drugs in the vehicle's trunk *", GetNameEx(playerid));
                                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                        if(!strcmp(item, "cocaine", true))
                        {
                                  if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store cocaine [amount]");
                                    return 1;

                                }
                            if(slot > Cocaine[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much cocaine.");
                                VehCoke[vehicleid] += slot;
                                Cocaine[playerid] -= slot;
                                if(VehicleSQLID[vehicleid] > 0)
                                {
                                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehCoke", VehCoke[vehicleid], "vehicles");
                                    MySQL_SetInteger(PlayerSQLID[playerid], "Cocaine", Cocaine[playerid], "accounts");
                                }
                                format(string, sizeof(string), "You have stored a %d gram(s) of cocaine in the vehicle's trunk.", slot);
                                SendClientMessage(playerid, COLOUR_BLUE, string);
                                format(string, sizeof(string), "* %s has stored some drugs in the vehicle's trunk. *", GetNameEx(playerid));
                                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                        if(!strcmp(item, "money", true))
                        {
                                  if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                                {
                                      SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store money [amount]");
                                    return 1;
                                    printf("MONEY AMOUNT CLEARED SSCANF");
                                    printf("VEH ID %d", vehicleid);
                                }
                                printf("VEH ID %d", vehicleid);
                            if(slot > PlayerMoney[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                            if(slot < 1 || slot  > 100000) return SendClientMessage(playerid, COLOUR_GREY, "The amount must be between $0 and $100,000");
                                VehCash[vehicleid] += slot;
                                PlayerMoney[playerid] -= slot;
                                GivePlayerMoney(playerid, -slot);
                                if(VehicleSQLID[vehicleid] > 0)
                                {
                                    MySQL_SetInteger(VehicleSQLID[vehicleid], "VehCash", VehCash[vehicleid], "vehicles");
                                    MySQL_SetInteger(PlayerSQLID[playerid], "Money", PlayerMoney[playerid], "accounts");
                                }
                                format(string, sizeof(string), "You have stored $%s in the vehicle, there is now a total of $%s in the vehicle's trunk.", AddCommas(slot), AddCommas(VehCash[vehicleid]));
                                SendClientMessage(playerid, COLOUR_BLUE, string);
                                format(string, sizeof(string), "* %s has stored some money in the vehicle's trunk *", GetNameEx(playerid));

                                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                        if(!strcmp(item, "armour", true))
                        {
                            GetPlayerArmour(playerid, PlayerArmour[playerid]);
                                new Float: armour;
                            if(sscanf(params, "s[24]s[32]f",usage,item,armour))
                            {
                                SendClientMessage(playerid, COLOUR_GREY, "Usage: /trunk store armour [amount]");
                                return 1;
                            }

                            if(armour < 1 || armour > 100)return SendClientMessage(playerid, COLOUR_GREY, "Amount must be between 0 and 100");
                            if(armour > PlayerArmour[playerid])return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much armour");

                            VehArmour[vehicleid] += armour;
                            PlayerArmour[playerid] -= armour;
                            SetPlayerArmour(playerid, -armour);
                                if(VehicleSQLID[vehicleid] > 0)
                                {
                                    MySQL_SetFloat(vehicleid, "VehArmour", VehArmour[vehicleid], "vehicles");
                                    MySQL_SetFloat(PlayerSQLID[playerid], "Armour", PlayerArmour[playerid], "accounts");
                                }

                            format(string, sizeof(string), "You have stored %d of armour, there is now a total of: %d armour in the vehicle's trunk.", floatround(armour), floatround(VehArmour[vehicleid]));
                            SendClientMessage(playerid, COLOUR_BLUE, string);
                            format(string, sizeof(string), "* %s has stored some armour in the vehicle's trunk. *", GetNameEx(playerid));
                            ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
                        }
                }//close store


Forums have messed up my paste. Here's the pastebin: http://ift.tt/1gvFlAT



the sscanf returns correctly (/trunk store money [amount]) but when I enter the amount nothing happens.


mercredi 29 juillet 2015

[Ajuda] Warning no sistema

Ta dando o seguinte erros

Code:

C:\Users\gustavo copello\Desktop\BSR ant\BSR GM OF - Cópia\Gamemodes\BSR.pwn(60398) : error 055: start of function body without function header
C:\Users\gustavo copello\Desktop\BSR ant\BSR GM OF - Cópia\Gamemodes\BSR.pwn(60400) : error 021: symbol already defined: "SetProgressBarValue"
C:\Users\gustavo copello\Desktop\BSR ant\BSR GM OF - Cópia\Gamemodes\BSR.pwn(60400) : error 017: undefined symbol "playerid"
C:\Users\gustavo copello\Desktop\BSR ant\BSR GM OF - Cópia\Gamemodes\BSR.pwn(60400) : error 021: symbol already defined: "UpdateProgressBar"
C:\Users\gustavo copello\Desktop\BSR ant\BSR GM OF - Cópia\Gamemodes\BSR.pwn(60400 -- 60401) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664                          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Nessas linhas não sei oque é :/

Code:

public Fome(playerid);
{
    SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
    SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome")); // Aqui a linha 60400
    UpdateProgressBar(FomeA,playerid);
    if(GetPVarInt(playerid,"Fome") >= 95)
    {
        new Float:Vida;
        GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        SendClientMessage(playerid,-1,"{AA3333}Vai Comer Um Lanche Ou Morrera.");
    }
    return 1;
}


Code:

public Fome(playerid);
{
    SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
    SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome"));
    UpdateProgressBar(FomeA,playerid);
    if(GetPVarInt(playerid,"Fome") >= 95)
    {
        new Float:Vida;
        GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        SendClientMessage(playerid,-1,"{AA3333}Vai Comer Um Lanche Ou Morrera.");
    }
    return 1;
}
public Sede(playerid);
{
    SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")+5);
    SetProgressBarValue(SedeB, GetPVarInt(playerid,"Sede"));
    UpdateProgressBar(SedeB,playerid);
    if(GetPVarInt(playerid,"Sede") >= 95)
    {
        new Float:Vida;
        GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        SendClientMessage(playerid,-1,"{AA3333}Vai Beber Uma Agua Ou Morrera.");
    }
    return 1;
}


é um sistema de fome e sede que encontrei e to tentando passar para minha gm :/ mas deu erro nas publics


[Ajuda] Nascer com colete.

galera como eu faço para colocar para o player ja nascer com colete, quando ele entrar no servidor, e dar spawn ?


mardi 28 juillet 2015

[FilterScript] Simple Real Time Clock SA:MP

Introduction

- It's a simple filter script that show the date , real time and server name top right ! That eGaming RPG it's not my server and it's a server where i played .. That was in my mind when i write that FS .
I Offer support down in comments ! I want you to rate me and be fare (i'm at beginning) . The criticisms are constructive , and yeah , almost i forgot - sorry for my bad english and i hope you understand me :rolleyes:


Credits

- SA:MP Team
- Wiper


How to modify

- You need to edit server name , and you can edit colors too without knowing much things .. So to put your server name in top right you need to search that line in my filter script .

Code:

#define SERV_NAME "eGaming RPG"
to edit colors you need to search that lines :

Code:

#define SNAME_COL 0x8A2BE2FF
#define SDATE_COL 0x7458C1FF
#define STIME_COL 0x1E90FFFF

Colors may be 0xRRGGBBAA , RR = Red | GG = Green | BB = Blue | AA = Alpha . So Hex colors with Alpha at final . There it's a site where you can find colors (Click me) or there with color picker (Click) .

You can modify too months (if you want it to be in your lang) - there

Code:

new const MonthName[][12] =
{
        "January", "February", "March", "April", "May", "June",
        "July",        "August", "September", "October", "November", "December"
};



Screenshot

- Click me

Download

- Pastebin (PWN)
- SolidFiles (PWN+AMX) [RAR]
- SolidFiles (PWN+AMX) [ZIP]


lundi 27 juillet 2015

Run time error 20

Hello Everyone
my server problem:
crashdetect plugin somtimes print this debug error in server console and always when somone tries to join

Code:

[debug] Run time error 20: "Invalid index parameter (bad entry point)"
Server Log:

Code:

[connection] 127.0.0.1:52575 requests connection cookie.
[connection] incoming connection: 127.0.0.1:52575 id: 0
[debug] Run time error 20: "Invalid index parameter (bad entry point)"
[join] Test has joined the server (0:127.0.0.1)

Note: I already have main() function in my gamemode.
i searched about this tun time error and everyone said add "main" to your game mode but i have it.

thanks in advance


dimanche 26 juillet 2015

[Ajuda] Servidor Crashando ao Conectar

Fala ai, sera que alguem pode me ajudar? Toda vez que qualquer player entra no meu servidor ele crasha dando diversos erros. O mais comum é oque vou deixar aqui em baixo.

PHP Code:

SA-MP 0.3.7
Exception At Address
0x03B0F6E3
Base
0x03B00000

Registers
:
EAX0x00000000    EBX0x00000DA2    ECX0x00000DA2    EDX0x00000000
ESI
0x01F43F5C    EDI0x01F43EE0    EBP0x0022F97C    ESP0x0022F950
EFLAGS
0x00010202

Stack
:
+
00000xFFFFFF00   0x03BA0397   0x0053DFE2   0xFFFFFFFF
+00100x0053EAA6   0x01595CEC   0x0053EAC4   0x43C80000
+00200x43960000   0x65EAE130   0x00000001   0x0022F994
+00300x65EAC643   0x0022F9B4   0x0022F9CC   0x65EFA858
+00400x00000000   0x0022F9BC   0x65EAE06E   0x65EFFAB0
+00500x01F43EE0   0x65EA316D   0x00000000   0x0022F99C
+00600x0022F9D4   0x00000001   0x01F43F4C   0x0022F9D8
+00700x65EACB47   0x0022F9E0   0x0022FA94   0x0022FA74
+00800x65EFA858   0x00000000   0x0022FA80   0x65EAE617
+00900x65EFF9C4   0x01F43EE0   0x65EFAAC1   0xFFFFFFFF
+00A00x00000000   0x65EAE587   0x0022FA94   0x0000001A
+00B00x00000001   0x00000000   0xFFFFFFFF   0x76F9881F
+00C00x76F988C9   0x00000000   0x00000001   0x00000000
+00D00x00000000   0x0022F9E0   0x0022FB9C   0x0022FA8C
+00E00x76FE62E3   0x05BED125   0xFFFFFFFE   0x76F9888D
+00F00x76F989B5   0x00000000   0x76F9914B   0x76F99180
+01000x65EFF9C4   0x01F43EE0   0x00000000   0x00000000
+01100x00000000   0x0210FEC8   0x01F43EE0   0x01F43F38
+01200x0022FA9C   0x0022FB9C   0x65EFAA60   0x00000001
+01300x0022FA8C   0x65EAE50C   0x0022FA94   0x76F87E90
+01400x0053ECC2   0x00000001   0x00619B71   0x0000001A
+01500x00000001   0x00000001   0x0000000A   0x00748DA0
+01600x0000001A   0x00000001   0x0000000A   0x0195AF48
+01700x0022FB68   0xFFFFFFFF   0x010A4000   0x4EC69FB7
+01800x041A0210   0x00000008   0x00000100   0x00000008
+01900x00000102   0x43C80000   0x43960000   0x00000000
+01A00x00000000   0x00000320   0x00000258   0x00000000
+01B00x00000001   0x003C07C4   0x00000200   0x00000000
+01C00x012C0190   0x027BC667   0x00000190   0x0000012C
+01D00x0000002C   0xFFFFFFFF   0x00000040   0x01F30000
+01E00x01F30000   0xFFFFFFFF   0x01F44018   0x0022FB48
+01F00x6F8F0CA5   0x01F30050   0x0022FB64   0x65EAE0D4
+02000x00400000   0x00000000   0x0195AF48   0x0000000A
+02100x01F43E90   0x01F43E8C   0x0022FBA8   0x65EAC7A8
+02200x0022FBC8   0x0022FBCC   0x0022FBD0   0x0022FBD4
+02300x01F43E10   0x01F43E8C   0x00000000   0x01F43E10
+02400x01F43E8C   0x0022FBB0   0x0022FC00   0x0022FC00
+02500x65EFA8A8   0x00000000   0x0022FBDC   0x65EAE10F
+02600x65EFFA70   0x01F43E10   0x00000000   0x01F4402C
+02700x0022FBB0   0x65EABA51   0x00400000   0x00000000

SCM Op
0x160lDbg0 LastRendObj0

Game Version
US 1.0

State Information
Ped Context

Agora o meu código

OnPlayerConnect: http://ift.tt/1MQKOvQ
OnPlayerLogin: http://ift.tt/1KsRZwY


Warning 213: tag mismatch

What's Wrong here.. why is it giving a warning (Warning 213: tag mismatch) Here:

PHP Code:

//My Enums
enum hinfo
{
    
id,
    
Cost,
    
Owner[MAX_PLAYER_NAME],
    
bool:hBought,
    
VW,
    
Interior,
    
Float:extX,
    
Float:extY,
    
Float:extZ,
    
Float:intX,
    
Float:intY,
    
Float:intZ,
    
hpickup,
    
htext,
};

new 
pHouse[MAX_HOUSES][hinfo]; 

PHP Code:

/*>>>---Here--->>>>*/UpdateDynamic3DTextLabelText(pHouse[i][htext],0x00B900AF,str5); 

PHP Code:

forward CreateHouse(hidcostFloat:xFloat:yFloat:zbool:Bought,hOwner[24]);
public 
CreateHouse(hidcostFloat:xFloat:yFloat:zbool:Bought,hOwner[24])
{
    
pHouse[hid][hpickup]=CreateDynamicPickup(1273,1,x,y,z);
    if(
Bought)
    {
        new 
str1[128];
        
format(str1,sizeof(str1),"House Owner: %s\nHID: %d",hOwner,hid);
/*>>>---Here--->>>>*/ pHouse[hid][htext]=CreateDynamic3DTextLabel(str1,0x00B900AF,x,y,z+1,5);
    }
    if(!
Bought)
    {
    new 
str2[128];
    
format(str2,sizeof(str2),"House for Sale\nCost: $%d\nHID: %d",cost,hid);
/*>>>>and Here--->>>>*/pHouse[hid][htext]=CreateDynamic3DTextLabel(str2,0x00B900AF,x,y,z+1,5);    
    }
return 
1;



and its also giving this warning: error 047: array sizes do not match, or destination array is too small

Here
PHP Code:

if(pHouse[i][id]==0)
            {
                
pHouse[i][id]=CreateHouse(i,cost,x,y,z,false,"NULL");
                
pHouse[i][Cost]=cost;
                
pHouse[i][hBought]=false;
            
/*Here-->*/pHouse[i][Owner]="NULL";
                
pHouse[i][VW]=GetPlayerVirtualWorld(playerid);    
                
pHouse[i][extX]=x;
                
pHouse[i][extY]=y;
                
pHouse[i][extZ]=z;
                new 
str3[123];
                
format(str3sizeof(str3),"{E85656}[House Created]{FFFFFF} You have successfully created House(ID:%d) Cost: $%d",i,cost);
                
SendClientMessage(playeridCOLOR_YELLOW,str3);
                break;
            }