/damages not working
#1

After applying PaulDinam's weapon damage encounter in my gamemode, the command doesn't work aswell its stock.
Код:
CMD:damages(playerid, params[])
{
	new id;
	if(sscanf(params, "d", id)) return Syntax(playerid,"damages", "[playerid]");
	if(!IsPlayerConnected(id)) return SendClientMessageEx(playerid, COLOR_LIGHTRED, "[ERROR]: {FFFFFF}This player is not connected.");
	DisplayDamages(playerid, id);
	return 1;
}
Код:
[DisplayDamages(playerid, giveplayerid)
{
	new playername[MAX_PLAYER_NAME], title[45];
	GetPlayerName(giveplayerid, playername, sizeof(playername));
	format(title, sizeof(title), "%s's weapon damages", playername);
	if(!CountDamages(giveplayerid)) return ShowPlayerDialog(playerid, 65000, DIALOG_STYLE_LIST, title, "There are no damages to display...", ">>>", "");
	new gText[1000], fstr[45];
	for(new i = 0; i < MAX_BODY_PARTS; i++)
	{
		for(new z = 0; z < MAX_WEAPONS; z++)
		{
			if(!Damage[giveplayerid][i][z]) continue;
			switch(i)
			{
				case 0 .. 15: format(fstr, sizeof(fstr), "%d hits from %s to the %s\n", Damage[giveplayerid][i][z], GetWeaponNameEx(z), GetBodyPartName(i + 3));
				case 54: format(fstr, sizeof(fstr), "%d falls to the %s\n", Damage[giveplayerid][i][z], GetBodyPartName(i));
				default: format(fstr, sizeof(fstr), "%d bullets from %s to the %s\n", Damage[giveplayerid][i][z], GetWeaponNameEx(z), GetBodyPartName(i + 3));
			}
			strcat(gText, fstr);
		}
	}
	ShowPlayerDialog(playerid, 65000, DIALOG_STYLE_LIST, title, gText, "Close", "");
	return 1;
}
Reply
#2

remove " [ " from DisplayDamages
For Example

Код:
DisplayDamages(playerid, giveplayerid)
{
	new playername[MAX_PLAYER_NAME], title[45];
	GetPlayerName(giveplayerid, playername, sizeof(playername));
	format(title, sizeof(title), "%s's weapon damages", playername);
	if(!CountDamages(giveplayerid)) return ShowPlayerDialog(playerid, 65000, DIALOG_STYLE_LIST, title, "There are no damages to display...", ">>>", "");
	new gText[1000], fstr[45];
	for(new i = 0; i < MAX_BODY_PARTS; i++)
	{
		for(new z = 0; z < MAX_WEAPONS; z++)
		{
			if(!Damage[giveplayerid][i][z]) continue;
			switch(i)
			{
				case 0 .. 15: format(fstr, sizeof(fstr), "%d hits from %s to the %s\n", Damage[giveplayerid][i][z], GetWeaponNameEx(z), GetBodyPartName(i + 3));
				case 54: format(fstr, sizeof(fstr), "%d falls to the %s\n", Damage[giveplayerid][i][z], GetBodyPartName(i));
				default: format(fstr, sizeof(fstr), "%d bullets from %s to the %s\n", Damage[giveplayerid][i][z], GetWeaponNameEx(z), GetBodyPartName(i + 3));
			}
			strcat(gText, fstr);
		}
	}
	ShowPlayerDialog(playerid, 65000, DIALOG_STYLE_LIST, title, gText, "Close", "");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)