View Single Post
Author Message
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 02-22-2016 , 16:16   Attach float value to weapons
Reply With Quote #1

Hello people,

i try to attach a float value to a weapon.

PHP Code:
new String:g_WeaponNames[3][16] = { "weapon_a""weapon_b""weapon_c"};
new 
Float:num[3] = {1.02.03.0};

public 
OnPluginStart()
{
     
HookEvent("player_death"EventPlayerDeath);
}

public 
EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
     
decl String:weapon[255];
     
GetEventString(event"weapon"weaponsizeof(weapon)); 
     
     new 
key FindStringInArray(g_WeaponNamesweapon);

     
PrintToChatAll("Debug: \x04%.2f"num[key]);

But get an "error 035: arrgument type mismatch" on findstring line. :/

Any ideas?
Or know someone a better possibility to realize this?

Thank you for the effort.
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter