Hello, I have a problem, I got these errors
Code:
error 035: argument type mismatch (argument 5) // Line 90
error 035: argument type mismatch (argument 6) // Line 91
My Code :
PHP Code:
#include <sourcemod>
#include <sdkhooks>
#pragma semicolon 1
#define PLUGIN_VERSION "1.0"
new Handle:c_defaultdamage = INVALID_HANDLE;
new Float:xDamage[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "Damage Multiplier",
author = "Whai",
description = "Multiply the damage of a player",
version = PLUGIN_VERSION,
url = ""
}
public OnPluginStart()
{
c_defaultdamage = CreateConVar("sm_defaultdmg", "1", "Default damage multiplier", 0, true, 0.0, false);
RegAdminCmd("sm_damage", Command_damage, ADMFLAG_SLAY, "Multiply the damage of a player");
}
public OnClientPutInServer(client)
{
xDamage[client] = GetConVarFloat(c_defaultdamage);
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public OnClientDisconnect(client)
{
xDamage[client] = GetConVarFloat(c_defaultdamage);
}
public Action OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
new Float:multiply = 1.0;
new Float:defaultmulti = GetConVarFloat(c_defaultdamage);
if (attacker > 0 && attacker <= MAXPLAYERS)
{
if(xDamage[attacker] != defaultmulti)
{
if(xDamage[attacker] == 0)
{
damage == 0.0;
}
else
{
damage *= multiply + xDamage[attacker] - 1.0;
}
}
}
if(victim == attacker)
{
damage *= 1.0;
}
return Plugin_Continue;
}
public Action Command_damage(client, args)
{
if(args == 0 && args == 2)
{
ReplyToCommand(client, "[SM] Usage: sm_damage <player> <multiplier>");
return Plugin_Handled;
}
new String:mdamage[32];
if(args == 1)
{
GetCmdArg(1, mdamage, sizeof(mdamage));
xDamage[client] = StringToFloat(mdamage);
PrintToChat(client, "Your Damage is now multipled by %i", mdamage);
}
new String:arg1[MAX_NAME_LENGTH];
GetCmdArg(1, arg1, sizeof(arg1));
new String:multiplier[32];
if(args == 2)
{
GetCmdArg(2, multiplier, sizeof(multiplier));
decl String:target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
if ((target_count = ProcessTargetString(
arg1,
client,
target_list,
MAXPLAYERS,
target_name, //Line 90
sizeof(target_name), //Line 91
tn_is_ml)) <= 0)
{
ReplyToTargetError(client, target_count);
return Plugin_Handled;
}
for (int i = 0; i < target_count; i++)
{
new target = target_list[i];
xDamage[target] = StringToFloat(multiplier);
}
if (tn_is_ml)
{
ShowActivity2(client, "[SM] ", "Multiplied damage %t by %d!", target_name, multiplier);
}
else
{
ShowActivity2(client, "[SM] ", "Multiplied damage %s by %d!", target_name, multiplier);
}
return Plugin_Handled;
}
return Plugin_Handled;
}
Errors :
PHP Code:
target_name,
sizeof(target_name),
Maybe I did a lot of errors (I think yes)
__________________