Raised This Month: $ Target: $400
 0% 

SOLVED


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
ArthHa
Member
Join Date: Apr 2014
Old 01-31-2017 , 18:47   SOLVED
#1

Hello, i want to create easiest way to use some of effects.

Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_const>

public plugin_init ()
{
register_clcmd( "say /test", "Test" );
}

stock MakeFx(Client,const format[],{_,Float}:...)
{
if(format)
{
switch(format)
{
case "fxLightning":
{
// (sprite index) 
// (life in 0.1's) 
// (line width in 0.1's) 
// (noise amplitude in 0.01's) 
// (red)
// (green)
// (blue)
// (brightness)
// (scroll speed in 0.1's)

if(callfunc_begin("fxLightning") )
{
client_print(Client,print_chat,"function called and executed");
}
}
default:
{
//not found
return PLUGIN_HANDLED;
}
}
}
return PLUGIN_HANDLED;
}

public Test(id)
{
MakeFx( id, "fxLightning" );
}
and i get this error:

array must be indexed (variable -"format")

Any ideas?;D
__________________



Last edited by asherkin; 02-04-2017 at 13:03. Reason: Restored post.
ArthHa is offline
Send a message via Skype™ to ArthHa
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-31-2017 , 19:25   Re: Make FX help.
#2

Use if-else if blocks instead of switch, because switch doesn't support strings. If you want to use switch you can create enumeration for all strings you need and map strings to this enumeration via Trie and switch mapped values which you can get via TrieGetCell.
__________________

Last edited by PRoSToTeM@; 01-31-2017 at 19:27.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Closed Thread



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

Forum Jump


All times are GMT -4. The time now is 20:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode