Raised This Month: $51 Target: $400
 12% 

I get one error, and I dont know why


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-19-2004 , 09:39   I get one error, and I dont know why
Reply With Quote #1

Theres 1 problem, but I cant figure it out, heres my code:

Code:
//////////////////////// #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> //////////////////////// new PlayerFx[33] //////////////////////// public plugin_init() {     register_plugin("Radom FX","0.1","Ashade")     register_clcmd("say /fx","GiveFx",0,": gives a random fx")     register_cvar("amx_fx","1")     register_logevent("StartRound",2,"1=Round_Start") } public StartRound() {     server_cmd("mp_freezetime 0")     new players[32], numberofplayers, i, cur_id     get_players(players,numberofplayers)     for (i=0;i<numberofplayers;i++)     {     cur_id = players[i]     PlayerFx[cur_id] = 0     }     return PLUGIN_HANDLED } public GiveFx(id) {     new name[33]     get_user_name(id,name,32)     if(get_cvar_num("amx_fx") != 1)     {         return PLUGIN_HANDLED     }     if(PlayerFx[id] == 1)     {         client_print(id,print_chat,"[AMX] You already have a random FX")     return PLUGIN_HANDLED     }     new RndFx = random_num(1,6)     if(PlayerFx[id] != 1)     {         if(RndFx == 1)         {         PlayerFx[id] = 1         set_user_gravity(id,0.5)         client_print(0,print_chat,"[AMX] %s has randomly been given low gravity",name)         return PLUGIN_HANDLED         }         if(RndFx == 2)     {         new pID[2]         pID[0] = id         PlayerFx[id] = 1         set_user_noclip(id,1)         client_print(0,print_chat,"[AMX] %s has randomly been given noclip for 10 sec.",name)         set_task(10.0,"stop_clip",0,pID,1)         return PLUGIN_CONTINUE         }         if(RndFx == 3)     {             PlayerFx[id] = 1         set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,50)             client_print(0,print_chat,"[AMX] %s has randomly been given transparency",name)             return PLUGIN_HANDLED         }     if(RndFx == 4)     {             PlayerFx[id] = 1         set_user_health(id,200)             client_print(0,print_chat,"[AMX] %s has randomly been given 200 hp",name)             return PLUGIN_HANDLED     }         if(RndFx == 5)     {         new pID[2]         pID[0] = id         PlayerFx[id] = 1             set_user_godmode(id,1)         client_print(0,print_chat,"[AMX] %s has randomly been given godmode for 10 sec.",name)         set_task(10.0,"stop_god",0,pID,1)         return PLUGIN_CONTINUE     }         if(RndFx == 6) && (cs_get_user_team(id) == "TERRORIST")     {         new pID[2]         pID[0] = id         PlayerFx[id] = 1             cs_set_user_model(id,"models\player\gign.mdl")         client_print(0,print_chat,"[AMX] %s has randomly had is player model changed for 10 sec.",name)         set_task(10.0,"stop_model",0,pID,1)         return PLUGIN_CONTINUE           }         if(RndFx == 6) && (cs_get_user_team(id) == "CT")     {         new pID[2]         pID[0] = id         PlayerFx[id] = 1             cs_set_user_model(id,"models\player\terror.mdl")         client_print(0,print_chat,"[AMX] %s has randomly had is player model changed for 10 sec.",name)         set_task(10.0,"stop_model",0,pID,1)         return PLUGIN_CONTINUE           }        return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public stop_clip(pID[0]) {     new name[33]     get_user_name(pID[0],name,32)     set_user_noclip(pID[0],0)     client_print(0,print_chat,"[AMX] Your 10 sec. of noclip are up %s",name)     return PLUGIN_HANDLED } public stop_god(pID[0]) {     new name[33]     get_user_name(pID[0],name,32)     set_user_godmode(pID[0],0)     client_print(0,print_chat,"[AMX] Your 10 sec. of noclip are up %s",name)     return PLUGIN_HANDLED } public stop_model(pID[0]) {     new name[33]     get_user_name(pID[0],name,32)     cs_reset_user_model(pID[0])     client_print(0,print_chat,"[AMX] Your 10 sec. of random model change are up %s",name)     return PLUGIN_HANDLED }

I dont think im using cs_get_user_team(id) correctly, plz HELP![/small]
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
BAILOPAN
Join Date: Jan 2004
Old 03-19-2004 , 10:04  
Reply With Quote #2

post the error, my eyes don't have a built in compiler
__________________
egg
BAILOPAN is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 03-19-2004 , 10:45  
Reply With Quote #3

LMAO
__________________
QwertyAccess is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-19-2004 , 11:01   Sry
Reply With Quote #4

sry about that:

Small compiler 2.1.0 Copyright (c) 1997-2002, ITB CompuPhase

Random_FX.sma(85) : error 029: invalid expression, assumed zero
Press any key to continue . . .
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 03-19-2004 , 11:12  
Reply With Quote #5

Wanna say what line 85 is? lol i don't feel like counting
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-19-2004 , 11:23   Line 85
Reply With Quote #6

Code:
if(RndFx == 6) && (cs_get_user_team(id) == "TERRORIST")
[/small]
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-19-2004 , 11:34  
Reply With Quote #7

shouldn't it be
Code:
if (RndFx = 6 && cs_get_user_team( id) = 1)
__________________
hello, i am pm
PM is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 03-19-2004 , 11:36  
Reply With Quote #8

yep

If you do like a cs_get_user_team(id,name,31)

You can do

if(containi("TERRORIST",name)!=-1)

But it is much easier to do cs_get_user_team

Here are the numbers it returns:
#define SPEC 0
#define TEAM_T 1
#define TEAM_CT 2
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-19-2004 , 12:11   Nope, aintworking
Reply With Quote #9

It still doesnt work I defines TEAM_T and such, then I did if(cs_get_user_team(id)==1) and it still wotn work, I get these errors:

Small compiler 2.1.0 Copyright (c) 1997-2002, ITB CompuPhase

Random_FX.sma(89) : error 029: invalid expression, assumed zero
Random_FX.sma(89 -- 90) : error 029: invalid expression, assumed zero
Random_FX.sma(99) : error 029: invalid expression, assumed zero
Random_FX.sma(99 -- 100) : error 029: invalid expression, assumed zero

4 Errors.
Press any key to continue . . .

the same spot as before
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-19-2004 , 12:13   WOW
Reply With Quote #10

nvm, I used amxer's idea and it fixed lol, thx again!
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
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 07:27.


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