Raised This Month: $ Target: $400
 0% 

Tag mismatch, problem with variable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 08-18-2009 , 07:59   Tag mismatch, problem with variable
Reply With Quote #1

PHP Code:
new const g_color[][] = { {0,40,40},{190,255,120} }; 
PHP Code:
new random_color random(sizeof(g_color))
fm_set_kvd(ent"rendercolor"random_color"env_fog"
PHP Code:
stock fm_set_kvd(entity, const key[], const value[], const className[] = "") {
    if (
className[0]) 
        
set_kvd(0KV_ClassNameclassName)
    else 
    {
        new class[
32]
        
pev(entitypev_classname, class, sizeof class - 1)
        
set_kvd(0KV_ClassName, class)
    }

    
set_kvd(0KV_KeyNamekey)
    
set_kvd(0KV_Valuevalue)
    
set_kvd(0KV_fHandled0)

    return 
dllfunc(DLLFunc_KeyValueentity0)

Tag mismatch 3, on this line :
PHP Code:
fm_set_kvd(ent"rendercolor"random_color"env_fog"
__________________
xbatista is offline
Send a message via Skype™ to xbatista
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 08-18-2009 , 08:07   Re: Tag mismatch, problem with variable
Reply With Quote #2

PHP Code:
new random_color g_color[random_num(0sizeof(g_color) - 1)] 
__________________
alan_el_more is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 08-18-2009 , 08:11   Re: Tag mismatch, problem with variable
Reply With Quote #3

Already tryied, array must be indexed etc...
__________________
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 08-18-2009 , 08:14   Re: Tag mismatch, problem with variable
Reply With Quote #4

ahhrrr was a problem , now look at it and it works
PHP Code:
fm_set_kvd(ent"rendercolor"g_color[random_num(0sizeof(g_color) - 1)], "env_fog"
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-18-2009 , 08:32   Re: Tag mismatch, problem with variable
Reply With Quote #5

It can't work. You need a STRING, something like "0 40 40". What you have done is wrong.
__________________
Arkshine is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 08-18-2009 , 09:26   Re: Tag mismatch, problem with variable
Reply With Quote #6

yea I tested I thought that was good, but it mixes 2 colors together :0
__________________
xbatista is offline
Send a message via Skype™ to xbatista
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-18-2009 , 18:41   Re: Tag mismatch, problem with variable
Reply With Quote #7

Code:
new const g_color[][] = {     "0 40 40",     "190 255 120" };
Code:
new random_color = random(sizeof(g_color)) fm_set_kvd(ent, "rendercolor", g_color[random_color], "env_fog")
__________________
hleV is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 08-19-2009 , 04:46   Re: Tag mismatch, problem with variable
Reply With Quote #8

Quote:
Originally Posted by hleV View Post
Code:
new const g_color[][] = {     "0 40 40",     "190 255 120" };
Code:
new random_color = random(sizeof(g_color)) fm_set_kvd(ent, "rendercolor", g_color[random_color], "env_fog")
Thanks will try it
EDIT: That worked
__________________

Last edited by xbatista; 08-19-2009 at 04:49.
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 08-19-2009 , 04:51   Re: Tag mismatch, problem with variable
Reply With Quote #9

Is it possible to put fog in plugin_init to work, cuz I've tryied and that not works, but maybe there are way to do it? I don't want use it in plugin_precache ?
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-19-2009 , 04:53   Re: Tag mismatch, problem with variable
Reply With Quote #10

Quote:
Originally Posted by xbatista View Post
I don't want use it in plugin_precache ?
Why?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 15:13.


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