2021-03-13, 11:53 PM
(2021-03-13, 10:37 PM)Y_Less Wrote: !) Can you show the code?
2) You should never call commands directly.
Well, this is the part of the code where the 26 errors occur, but it happens wherever I have the "cmd_" it is really something very disconcerting that this would happen just by changing the words.
Code:
forward OnPlayerUseItem(playerid, itemid, name[]);
public OnPlayerUseItem(playerid, itemid, name[])
{
? ? if (IsFurnitureItem(name))
{
? ? ? ? new id = House_Inside(playerid);
? ? ? ? if (id == -1)
? ? ? ? ? ? return SendErrorMessage(playerid, "Debes estar dentro de una casa para colocar muebles.");
if (!House_IsOwner(playerid, id))
? ? return SendErrorMessage(playerid, "Solo puedes colocar muebles en tu propia casa.");
static
? ? Float:x,
? ? Float:y,
? ? Float:z,
? ? Float:angle;
? ? ? ? GetPlayerPos(playerid, x, y, z);
? ? ? ? GetPlayerFacingAngle(playerid, angle);
? ? ? ? x = 5.0 * floatsin(-angle, degrees);
? ? ? ? y = 5.0 * floatcos(-angle, degrees);
if (Furniture_GetCount(id) > MAX_HOUSE_FURNITURE)
? ? return SendErrorMessage(playerid, "Solo puedes tener %d muebles en tu casa.", MAX_HOUSE_FURNITURE);
new furniture = Furniture_Add(id, name, InventoryData[playerid][itemid][invModel], x, y, z, 0.0, 0.0, angle);
if (furniture == -1)
? ? return SendErrorMessage(playerid, "El servidor ha alcanzado el l?mite de mobiliario.");
Inventory_Remove(playerid, name);
PlayerData[playerid][pEditFurniture] = furniture;
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s ha desplegado su \"%s\".", ReturnName(playerid, 0), name);
EditDynamicObject(playerid, FurnitureData[furniture][furnitureObject]);
}
else if (!strcmp(name, "Cargador", true)) {
? ? cmd_usarcarg(playerid, "\1");
}
else if (!strcmp(name, "Boombox", true)) {
? ? cmd_boombox(playerid, "lugar");
}
else if (!strcmp(name, "Mochila", true)) {
? ? cmd_mochila(playerid, "\1");
}
else if (!strcmp(name, "Primeros auxilios", true)) {
? ? ? ? cmd_utikit(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Tel?fono", true)) {
? ? ? ? cmd_telefono(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Radio portatil", true)) {
? ? ? ? SendSyntaxMessage(playerid, "Use \"/pr [text]\" para charlar con tu radio.");
? ? }
? ? else if (!strcmp(name, "Lata de combustible", true)) {
? ? ? ? cmd_llenar(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Kit de reparacion", true)) {
? ? ? ? cmd_reparar(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Recipiente NOS", true)) {
? ? ? ? cmd_nitro(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Lata de aerosol", true)) {
? ? ? ? cmd_pintar(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Sistema GPS", true)) {
? ? ? ? cmd_gps(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Marihuana", true)) {
? ? ? ? cmd_usardr(playerid, "Marihuana");
? ? }
? ? else if (!strcmp(name, "Cocaina", true)) {
? ? ? ? cmd_usardr(playerid, "cocaina");
? ? }
? ? else if (!strcmp(name, "Heroina", true)) {
? ? ? ? cmd_usardr(playerid, "heroina");
? ? }
? ? else if (!strcmp(name, "Esteroides", true)) {
? ? ? ? cmd_usardr(playerid, "Esteroides");
? ? }
? ? else if (!strcmp(name, "Soda", true)) {
? ? ? ? cmd_beber(playerid, "soda");
? ? }
? ? else if (!strcmp(name, "Botella de agua", true)) {
? ? ? ? cmd_beber(playerid, "agua");
? ? }
? ? else if (!strcmp(name, "Pizza congelada", true)) {
? ? ? ? cmd_cocinar(playerid, "pizza");
? ? }
? ? else if (!strcmp(name, "Hamburguesa congelada", true)) {
? ? ? ? cmd_cocinar(playerid, "hamburguesa");
? ? }
? ? else if (!strcmp(name, "Chaleco blindado", true)) {
? ? ? ? cmd_chaleco(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Ammo Cartridge", true)) {
? ? ? ? cmd_municion(playerid, "\1");
? ? }
? ? else if (!strcmp(name, "Colt 45", true)) {
? ? ? ? EquipWeapon(playerid, "Colt 45");
? ? }
? ? else if (!strcmp(name, "Desert Eagle", true)) {
? ? ? ? EquipWeapon(playerid, "Desert Eagle");
? ? }
? ? else if (!strcmp(name, "Escopeta", true)) {
? ? ? ? EquipWeapon(playerid, "Escopeta");
? ? }
? ? else if (!strcmp(name, "Micro SMG", true)) {
? ? ? ? EquipWeapon(playerid, "Micro SMG");
? ? }
? ? else if (!strcmp(name, "Tec-9", true)) {
? ? ? ? EquipWeapon(playerid, "Tec-9");
? ? }
? ? else if (!strcmp(name, "MP5", true)) {
? ? ? ? EquipWeapon(playerid, "MP5");
? ? }
? ? else if (!strcmp(name, "AK-47", true)) {
? ? ? ? EquipWeapon(playerid, "AK-47");
? ? }
? ? else if (!strcmp(name, "M4", true)) {
? ? ? ? EquipWeapon(playerid, "M4");
? ? }
? ? else if (!strcmp(name, "Rifle", true)) {
? ? ? ? EquipWeapon(playerid, "Rifle");
? ? }
? ? else if (!strcmp(name, "Sniper", true)) {
? ? ? ? EquipWeapon(playerid, "Sniper");
? ? }
? ? else if (!strcmp(name, "Palo de golf", true)) {
? ? ? ? EquipWeapon(playerid, "Palo de golf");
? ? }
? ? else if (!strcmp(name, "Cuchillo", true)) {
? ? ? ? EquipWeapon(playerid, "Cuchillo");
? ? }
? ? else if (!strcmp(name, "Pala", true)) {
? ? ? ? EquipWeapon(playerid, "Pala");
? ? }
? ? else if (!strcmp(name, "Katana", true)) {
? ? ? ? EquipWeapon(playerid, "Katana");
? ? }
? ? else if (!strcmp(name, "Semillas de marihuana", true)) {
? ? ? ? cmd_plantar(playerid, "Marihuana");
? ? }
? ? else if (!strcmp(name, "Semillas de cocaina", true)) {
? ? ? ? cmd_plantar(playerid, "Cocaina");
? ? }
? ? else if (!strcmp(name, "Semillas de heroina opio", true)) {
? ? ? ? cmd_plantar(playerid, "Heroina");
? ? }
? ? else if (!strcmp(name, "Palanca", true)) {
? ? ? ? cmd_palanca(playerid, "Palanca");
? ? }
? ? else if (!strcmp(name, "Destornillador", true)) {
? ? ? ? cmd_destornillador(playerid, "Destornillador");
? ? }
? ? else if (!strcmp(name, "Pizza cocida", true))
{
? ? ? ? if (PlayerData[playerid][pHunger] > 90)
? ? ? ? ? ? return SendErrorMessage(playerid, "No tienes hambre ahora mismo.");
? ? ? ? if (!IsPlayerAttachedObjectSlotUsed(playerid, 4))
{
? ? SetPlayerAttachedObject(playerid, 4, 2702, 6, 0.173041, 0.049197, 0.056789, 0.000000, 274.166107, 299.057983, 1.000000, 1.000000, 1.000000);
SetTimerEx("RemoveAttachedObject", 3000, false, "dd", playerid, 4);
}
? ? ? ? PlayerData[playerid][pHunger] = (PlayerData[playerid][pHunger] 15 > 100) ? (100) : (PlayerData[playerid][pHunger] 15);
Inventory_Remove(playerid, "Pizza cocida");
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.1, 0, 0, 0, 0, 0, 1);
? ? ? ? SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s toma una rebanada de pizza y se la come.", ReturnName(playerid, 0));
? ? }
? ? else if (!strcmp(name, "Hamburguesa cocida", true))
{
? ? if (PlayerData[playerid][pHunger] > 90)
? ? ? ? ? ? return SendErrorMessage(playerid, "No tienes hambre ahora mismo.");
if (!IsPlayerAttachedObjectSlotUsed(playerid, 4))
{
? ? SetPlayerAttachedObject(playerid, 4, 2703, 6, 0.078287, 0.019677, -0.001004, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SetTimerEx("RemoveAttachedObject", 3000, false, "dd", playerid, 4);
}
? ? ? ? PlayerData[playerid][pHunger] = (PlayerData[playerid][pHunger] 20 > 100) ? (100) : (PlayerData[playerid][pHunger] 20);
Inventory_Remove(playerid, "Hamburguesa cocida");
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.1, 0, 0, 0, 0, 0, 1);
? ? ? ? SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s hace una hamburguesa cocida y se la come.", ReturnName(playerid, 0));
? ? }
? ? else if (!strcmp(name, "Pollo", true))
{
? ? if (PlayerData[playerid][pHunger] > 90)
? ? ? ? ? ? return SendErrorMessage(playerid, "No tienes hambre ahora mismo.");
? ? ? ? PlayerData[playerid][pHunger] = (PlayerData[playerid][pHunger] 25 > 100) ? (100) : (PlayerData[playerid][pHunger] 25);
Inventory_Remove(playerid, "Pollo");
ApplyAnimation(playerid, "VENDING", "VEND_Eat_P", 4.1, 0, 0, 0, 0, 0, 1);
? ? ? ? SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s toma un trozo de pollo y se lo come.", ReturnName(playerid, 0));
? ? }
? ? return 1;
}