Raised This Month: $ Target: $400
 0% 

Help to: payment for a function.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 03-30-2005 , 15:05   Help to: payment for a function.
Reply With Quote #1

First I will past the script:

Code:
#include <amxmodx> #include <cstrike> #include <fun> public plugin_init() {     register_plugin("Auto Healing","1.0","stigma")     register_clcmd("say /heal","autoHeal",0,"Gives a client +3HP for 15 seconds")     register_event("DeathMsg","annouce","a","0") } public autoHeal(id) {         new health = get_user_health( id )         if(health >= 50) {                 set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 6)         show_hudmessage(id,"Your health have to be below 50!")         }                     if(health < 40) {         new sHealth = get_user_health( id ) + 5         new fHealth = 50 - health - 5                 set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 3)         show_hudmessage(id,"Current health: %i^nHealth needed before 50: %i",sHealth,fHealth)             set_user_health(id, health+5)                 set_task(1.0,"autoHeal",id)                 return PLUGIN_HANDLED             }         if((health < 50) & (health >= 40)) {                 set_user_health(id, health+1)                 new slHealth = get_user_health( id )         new fHealth = 50 - health - 1                 set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 4)         show_hudmessage(id,"Current health: %i^nHealth needed before 50: %i",slHealth,fHealth)                         set_task(1.0,"autoHeal",id)                 return PLUGIN_HANDLED     }         return PLUGIN_HANDLED     } public annouce() {         set_hudmessage(40,100,50, 0.20, 0.30, 2, 0.05, 5.0, 0.01, 0.1, 5)     show_hudmessage(0,"Use /heal to get auto healed until you have 50 hp^nIt would cost you 3000$")     }

This works fine, but as soon I put:
Code:
cs_get_user_money( id )
into the script, it returns 'bad load'. Anyone who can help me with this problem?

What I want to do is: When a client write /heal - it should cost him 3000$ and I have tryed to make that. But when I do that, it returns bad load...

And also the last function 'annouce'. I want the message to appear every 15 minutes, with a task, but I don't know how I can do that, or actualy, I do know this: I tryed
Code:
set_task(900.0,"annouce",id,_,_,"b",_)
because I was told that the underscore was like a 'skipper' so it would skip the paraments.
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 03-30-2005 , 16:17  
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=11156

Something like this?
__________________
KyleD is offline
Send a message via MSN to KyleD
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 03-30-2005 , 16:43  
Reply With Quote #3

Yea. I've tryed the same, but there aint happing anything....
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-30-2005 , 17:40  
Reply With Quote #4

Try using PLUGIN_CONTINUE..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-01-2005 , 12:23  
Reply With Quote #5

Dosent work - im getting bad load when i put 'cs_get_user_money' into the script - http://forums.alliedmods.net/showthread.php?t=11868
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-01-2005 , 16:36  
Reply With Quote #6

Code:
public annouce() {         set_hudmessage(40,100,50, 0.20, 0.30, 2, 0.05, 5.0, 0.01, 0.1, 5)     show_hudmessage(0,"Use /heal to get auto healed until you have 50 hp^nIt would cost you 3000$")     // Doesn't return anything? }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-01-2005 , 17:03  
Reply With Quote #7

Ooh i'll try

Edit: Dosen't work....
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Ced
Member
Join Date: Oct 2004
Old 04-02-2005 , 12:18  
Reply With Quote #8

you can try this but did not test

Code:
#include <amxmodx> #include <cstrike> #include <fun> #define price 3000 public plugin_init() {     register_plugin("Auto Healing","1.0","stigma")     register_clcmd("say /heal","autoHeal",0,"Gives a client +3HP for 15 seconds")     set_task(900.0, "annouce", 0, _, _, "b") } public autoHeal(id) {           new health = get_user_health( id )           if(health >= 50) {                   set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 6)         show_hudmessage(id,"Your health have to be below 50!")         return PLUGIN_HANDLED     }     else if(cs_get_user_money(id) < price) {         client_print(id, print_center,"You need $3000 to heal")         return PLUGIN_HANDLED     }               else if(health < 40) {         cs_set_user_money(id, cs_get_user_money(id) - price)                 new sHealth = get_user_health( id ) + 5         new fHealth = 50 - health - 5                   set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 3)         show_hudmessage(id,"Current health: %i^nHealth needed before 50: %i",sHealth,fHealth)               set_user_health(id, health+5)                   set_task(1.0,"autoHeal",id)     }     else if((health < 50) & (health >= 40)) {         cs_set_user_money(id, cs_get_user_money(id) - price)         set_user_health(id, health+1)                   new slHealth = get_user_health( id )         new fHealth = 50 - health - 1                   set_hudmessage(40,100,50, 0.03, 0.76, 2, 0.02, 1.0, 0.01, 0.1, 4)         show_hudmessage(id,"Current health: %i^nHealth needed before 50: %i",slHealth,fHealth)                             set_task(1.0,"autoHeal",id)     }           return PLUGIN_HANDLED       } public annouce() {           set_hudmessage(40,100,50, 0.20, 0.30, 2, 0.05, 5.0, 0.01, 0.1, 5)     show_hudmessage(0,"Use /heal to get auto healed until you have 50 hp^nIt will cost you 3000$")       }
Ced 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 09:50.


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