SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 24/09/2015, 03:06 PM   #1
SinisterAvenger
Little Clucker
 
Join Date: Sep 2015
Posts: 12
Reputation: 0
Post ScavengeSurvive com munição infinita!

Olá, meu servidor de scavenge está com um bug muito escroto em que as armas não acabam a munição, eu achei alguns erros no arquivo ammunation que acho que pode ter a ver, eu não faço a minima ideia de como resolverer e preciso muito de ajuda:





Erros:


Code:
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(32) : error 017: undefined symbol "ITM_MAX_TYPES"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(77) : warning 235: public function lacks forward declaration (symbol "OnItemNameRender")
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(100) : warning 213: tag mismatch
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(106) : error 017: undefined symbol "GetItemExtraData"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(107) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(107) : warning 217: loose indentation
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(107) : error 036: empty statement
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(109) : warning 217: loose indentation
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(109) : error 017: undefined symbol "format"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(109) : error 017: undefined symbol "str"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(112) : warning 217: loose indentation
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(112) : error 029: invalid expression, assumed zero
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(112) : warning 215: expression has no effect
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(114) : warning 217: loose indentation
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(114) : error 017: undefined symbol "SetItemNameExtra"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(98) : warning 203: symbol is never used: "itemid"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(98 -- 119) : warning 235: public function lacks forward declaration (symbol "OnItemCreate")
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(98 -- 121) : error 017: undefined symbol "GetItemLootIndex"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(123) : error 017: undefined symbol "GetItemType"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(127) : error 017: undefined symbol "SetItemExtraData"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(244) : error 017: undefined symbol "IsValidItemType"
C:\Users\JuniorVM\Downloads\Gamemode antiga\gamemodes\SS\Core\Weapon\ammunition.pwn(247) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.


Código:

Code:
#define MAX_ITEM_AMMO_TYPES		(20)
#define MAX_AMMO_CALIBRE		(20)
#define MAX_AMMO_CALIBRE_NAME	(32)
#define NO_CALIBRE				(-1)


enum e_calibre_data
{
			clbr_name[MAX_AMMO_CALIBRE_NAME],
Float:		clbr_bleedRate
}

enum E_ITEM_AMMO_DATA
{
ItemType:	ammo_itemType,
			ammo_name[MAX_AMMO_CALIBRE_NAME],
			ammo_calibre,
Float:		ammo_bleedrateMult,
Float:		ammo_knockoutMult,
Float:		ammo_penetration,
			ammo_size
}


static
			clbr_Data[MAX_AMMO_CALIBRE][e_calibre_data],
			clbr_Total;

static
			ammo_Data[MAX_ITEM_AMMO_TYPES][E_ITEM_AMMO_DATA],
			ammo_Total,
			ammo_ItemTypeAmmoType[ITM_MAX_TYPES] = {-1, ...},
ItemType:	ammo_ItemTypeLowerBound,
ItemType:	ammo_ItemTypeUpperBound;


/*==============================================================================
	Core
==============================================================================*/


stock DefineAmmoCalibre(name[], Float:bleedrate)
{
	strcat(clbr_Data[clbr_Total][clbr_name], name, MAX_AMMO_CALIBRE_NAME);
	clbr_Data[clbr_Total][clbr_bleedRate] = bleedrate;

	return clbr_Total++;
}

stock DefineItemTypeAmmo(ItemType:itemtype, name[], calibre, Float:bleedratemult, Float:knockoutmult, Float:penetration, size)
{
	ammo_Data[ammo_Total][ammo_itemType] = itemtype;
	strcat(ammo_Data[ammo_Total][ammo_name], name, MAX_AMMO_CALIBRE_NAME);
	ammo_Data[ammo_Total][ammo_calibre] = calibre;
	ammo_Data[ammo_Total][ammo_bleedrateMult] = bleedratemult;
	ammo_Data[ammo_Total][ammo_knockoutMult] = knockoutmult;
	ammo_Data[ammo_Total][ammo_penetration] = penetration;
	ammo_Data[ammo_Total][ammo_size] = size;

	ammo_ItemTypeAmmoType[itemtype] = ammo_Total;

	if(itemtype < ammo_ItemTypeLowerBound)
		ammo_ItemTypeLowerBound = itemtype;

	else if(itemtype > ammo_ItemTypeUpperBound)
		ammo_ItemTypeUpperBound = itemtype;

	return ammo_Total++;
}


/*==============================================================================
	Hook
==============================================================================*/


public OnItemNameRender(itemid, ItemType:itemtype)
{
	ammunition_NameRenderHandler(itemid, itemtype);

	#if defined ammo_OnItemNameRender
		return ammo_OnItemNameRender(itemid, itemtype);
	#else
		return 0;
	#endif
}
#if defined _ALS_OnItemNameRender
	#undef OnItemNameRender
#else
	#define _ALS_OnItemNameRender
#endif

#define OnItemNameRender ammo_OnItemNameRender
#if defined ammo_OnItemNameRender
	forward ammo_OnItemNameRender(itemid, ItemType:itemtype);
#endif

ammunition_NameRenderHandler(itemid, ItemType:itemtype)
{
	new ammotype = ammo_ItemTypeAmmoType[itemtype];

	if(ammotype == -1)
		return 0;

	new
		amount = GetItemExtraData(itemid),
		str[ITM_MAX_TEXT];

	format(str, sizeof(str), "%d, %s, %s",
		amount,
		clbr_Data[ammo_Data[ammotype][ammo_calibre]][clbr_name],
		ammo_Data[ammotype][ammo_name]);

	SetItemNameExtra(itemid, str);

	return 1;
}

public OnItemCreate(itemid)
{
	if(GetItemLootIndex(itemid) != -1)
	{
		new ammotype = GetItemTypeAmmoType(GetItemType(itemid));

		if(ammotype != -1)
		{
			SetItemExtraData(itemid, ammo_Data[ammotype][ammo_size] == 1 ? random(1) : random(ammo_Data[ammotype][ammo_size] - 1) + 1);
		}
	}

	#if defined ammo_OnItemCreate
		return ammo_OnItemCreate(itemid);
	#else
		return 1;
	#endif
}
#if defined _ALS_OnItemCreate
	#undef OnItemCreate
#else
	#define _ALS_OnItemCreate
#endif

#define OnItemCreate ammo_OnItemCreate
#if defined ammo_OnItemCreate
	forward ammo_OnItemCreate(itemid);
#endif


/*==============================================================================
	Interface
==============================================================================*/


// clbr_name
stock GetCalibreName(calibre, name[MAX_AMMO_CALIBRE_NAME])
{
	if(!(0 <= calibre < clbr_Total))
		return 0;

	name[0] = EOS;
	strcat(name, clbr_Data[calibre][clbr_name]);

	return 1;
}

// clbr_bleedRate
stock Float:GetCalibreBleedRate(calibre)
{
	if(!(0 <= calibre < clbr_Total))
		return 0.0;

	return clbr_Data[calibre][clbr_bleedRate];
}

// ammo_itemType
stock ItemType:GetAmmoTypeItemType(ammotype)
{
	if(!(0 <= ammotype < ammo_Total))
		return INVALID_ITEM_TYPE;

	return ammo_Data[ammotype][ammo_itemType];
}

// ammo_name
stock GetAmmoTypeName(ammotype, name[])
{
	if(!(0 <= ammotype < ammo_Total))
		return 0;

	name[0] = EOS;
	strcat(name, ammo_Data[ammotype][ammo_name], MAX_AMMO_CALIBRE_NAME);

	return 1;
}

// ammo_calibre
stock GetAmmoTypeCalibre(ammotype)
{
	if(!(0 <= ammotype < ammo_Total))
		return 0;

	return ammo_Data[ammotype][ammo_calibre];
}

// ammo_bleedrateMult
stock Float:GetAmmoTypeBleedrateMultiplier(ammotype)
{
	if(!(0 <= ammotype < ammo_Total))
		return 0.0;

	return ammo_Data[ammotype][ammo_bleedrateMult];
}

// ammo_knockoutMult
stock Float:GetAmmoTypeKnockoutMultiplier(ammotype)
{
	if(!(0 <= ammotype < ammo_Total))
		return 0.0;

	return ammo_Data[ammotype][ammo_knockoutMult];
}

// ammo_penetration
stock Float:GetAmmoTypePenetration(ammotype)
{
	if(!(0 <= ammotype < ammo_Total))
		return 0.0;

	return ammo_Data[ammotype][ammo_penetration];
}

// ammo_size
stock GetAmmoTypeSize(ammotype)
{
	if(!(0 <= ammotype < ammo_Total))
		return 0;

	return ammo_Data[ammotype][ammo_size];
}


stock GetItemTypeAmmoType(ItemType:itemtype)
{
	if(!IsValidItemType(itemtype))
		return -1;

	return ammo_ItemTypeAmmoType[itemtype];
}

stock GetItemTypeCalibre(ItemType:itemtype)
{
	if(!IsValidItemType(itemtype))
		return -1;

	if(ammo_ItemTypeAmmoType[itemtype] == -1)
		return -1;

	return ammo_Data[ammo_ItemTypeAmmoType[itemtype]][ammo_calibre];
}

stock GetItemTypeMagSize(ItemType:itemtype)
{
	if(!IsValidItemType(itemtype))
		return -1;

	if(ammo_ItemTypeAmmoType[itemtype] == -1)
		return -1;

	return ammo_Data[ammo_ItemTypeAmmoType[itemtype]][ammo_size];
}

stock GetAmmoItemTypesOfCalibre(calibre, ItemType:output[], max = sizeof(output))
{
	new idx;

	for(new i; i < ammo_Total && idx < max; i++)
	{
		if(ammo_Data[i][ammo_calibre] == calibre)
			output[idx++] = ammo_Data[i][ammo_itemType];
	}

	return idx;
}
SinisterAvenger is offline   Reply With Quote
Old 24/09/2015, 03:16 PM   #2
NikiFor
Huge Clucker
 
NikiFor's Avatar
 
Join Date: Apr 2014
Location: D:\
Posts: 434
Reputation: 88
Default Re: ScavengeSurvive com munição infinita!

Cara, eu sou cego não e acho que aqui ninguem é também... Formate esse texto denovo, eu não consigo ler nada direito de tão grande que é (to no cel)
__________________
NikiFor is offline   Reply With Quote
Old 24/09/2015, 03:27 PM   #3
SinisterAvenger
Little Clucker
 
Join Date: Sep 2015
Posts: 12
Reputation: 0
Default Re: ScavengeSurvive com munição infinita!

Quote:
Originally Posted by NikiFor View Post
Cara, eu sou cego não e acho que aqui ninguem é também... Formate esse texto denovo, eu não consigo ler nada direito de tão grande que é (to no cel)
Pronto
__________________
Procuro Scripter's experientes para servidor de Scavenge & Survive
Contato:
Skype: junin_viana
WhatsApp: +556796428699
SinisterAvenger is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Vida infinita NuTShoT Português/Portuguese 4 21/01/2013 05:05 PM
[AJUDA] Armas infinita Chis Português/Portuguese 6 22/04/2012 09:43 PM


All times are GMT. The time now is 03:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.