Raised This Month: $ Target: $400
 0% 

Is this the correct syntax?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 06-19-2006 , 19:53   Is this the correct syntax?
Reply With Quote #1

Code:
        new health[33]         get_user_health(id, health, 32)         set_user_health(id, health + 150)         client_print(id, print_chat, "[Customs] You upgrade your health, its now at %i." health)
or
Code:
        new health[33] = get_user_health(id)         set_user_health(id, health + 150)         client_print(id, print_chat, "[Customs] You upgrade your health, its now at %i." health)
It is all very confusing to me.... >.<
TheNewt is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 19:54  
Reply With Quote #2

2nd one.
wonsae is offline
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 06-19-2006 , 19:58  
Reply With Quote #3

Code:
/home/users/amxmodx/tmp3/textmgEflP.sma(143) : error 088: number of arguments does not match definition
/home/users/amxmodx/tmp3/textmgEflP.sma(144) : error 033: array must be indexed (variable "health")
/home/users/amxmodx/tmp3/textmgEflP.sma(145) : error 001: expected token: ",", but found "-identifier-"
/home/users/amxmodx/tmp3/textmgEflP.sma(145) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/textmgEflP.sma(145) : error 001: expected token: ";", but found ")"
/home/users/amxmodx/tmp3/textmgEflP.sma(145) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/textmgEflP.sma(145) : fatal error 107: too many error messages on one line
eh... compiling errors with the second one... new health is 142, client print is 146... just something is wrong about that code... I'm gonna go check funcwiki again for the 20th time...
TheNewt is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 20:03  
Reply With Quote #4

Lemme see the code.
wonsae is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 20:07  
Reply With Quote #5

I think you're trying to do this:

Code:
 new health         get_user_health(id, health)         set_user_health(id, health + 150)         client_print(id, print_chat, "[Customs] You upgrade your health, its now at %i." health)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 06-19-2006 , 20:15   Exactly
Reply With Quote #6

Yes Hawk, thats exactly what I was going for, I eventually got it before deciding to refresh the page, but I also tried compiling it before refreshing the page and I got some errrors... get_user_health(id, health + 150)

but i got this
Code:
: error 088: number of arguments does not match definition
when i tried compiling.
TheNewt is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 20:16  
Reply With Quote #7

Remove + 150
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 06-19-2006 , 20:30  
Reply With Quote #8

Haha I'm smart, this worked!
Code:
        new oldhealth = get_user_health(id)         new newhealth = oldhealth + 150         set_user_health(id, newhealth)         client_print(id, print_chat, "[Customs] You upgrade your health, its now at %i.", newhealth)
TheNewt is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 21:20  
Reply With Quote #9

That's stupid, just make oldhealth = get_user_health(id) + 150
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 06-20-2006 , 00:28  
Reply With Quote #10

Gives me a compiling error if I do that.
TheNewt 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 08:06.


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