Raised This Month: $ Target: $400
 0% 

suprise


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-20-2005 , 16:51   suprise
Reply With Quote #1

i want to make a suprise plugin and i need a start i made this little code not finsihed but it isn't working i'm new to making plugins i ported some and
can someone tell's me what
Code:
return PLUGIN_CONITNUE return PLUGIN_HANDLED
means and what does this means a little better explained like what does global event do and specified maybe that is my problem
Code:
* "a" - global event. * "b" - specified. * "c" - send only once when repeated to other players. * "d" - call if is send to dead player. * "e" - to alive.
here is my plugin
Code:
#include <amxmodx> #include <fun> #define sv_maxspeed 1000 new kills[33] = {0,...}; new deaths[33] = {0,...}; new Float:speed = 1000 public plugin_init() {     register_plugin("suprise","1.0","Nightscream")     register_event("Kill10","Ksuprise_message","b")     register_event("Death10","Dsuprise","b")         return PLUGIN_CONTINUE } public Ksuprise_message(id) {     if (kills[id] == 9) {         client_print(id, print_chat,"[AMXX]if you kill 1 person without get killed you get a suprise");     } } public Dsuprise(id) {     if ((deaths[id] == 10)&(kills[id] < 10)) {         set_user_maxspeed(id,speed);         client_print(id,print_chat,"[AMXX]you have superspeed for one round");     } }
compiles with no errors 1 warning
Quote:
//AMXXSC compile.exe
// by the AMX Mod X Dev Team


//// suprise.sma
// C:\Documents and Settings\Ward1\Bureaublad\counter-strike\addons\amxmodx\scri
pting\suprise.sma(10) : warning 213: tag mismatch
Quote:
Originally Posted by debug
L 04/20/2005 - 22:52:00: [AMXX] Invalid event (name "Kill10") (plugin "suprise.amxx")
L 04/20/2005 - 22:52:00: [AMXX] Native error in "register_event" on line 12 (file "suprise.sma"
__________________
- Bye bye!
nightscreem is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-20-2005 , 16:58  
Reply With Quote #2

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

for the return explaination.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-20-2005 , 17:00  
Reply With Quote #3

thx man i get it now
now the plugin
and the flags
__________________
- Bye bye!
nightscreem is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-20-2005 , 17:06  
Reply With Quote #4

register_event("Death10","Dsuprise","b") Are you trying to catch the death event?

Quote:
public Dsuprise(id) {
if ((deaths[id] == 10)&(kills[id] < 10)) {
set_user_maxspeed(id,speed);
client_print(id,print_chat,"[AMXX]you have superspeed for one round");
}
}
let me understand this what your plugin is suppose to do.

So when they have a death it suppose to trigger dsuprise? and if they have deaths equal to 10 and kills is less than 10, they get super speed for one round?


Also you don't need return PLUGIN_CONTINUE in public plugin_init()
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-20-2005 , 17:15  
Reply With Quote #5

yes
if death= 10 and there kills are less then 10 they get superspeed for one round and if they have 9 kills it sayes to that player if you kill 1 person without get killed you get a suprise
__________________
- Bye bye!
nightscreem is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-20-2005 , 17:27  
Reply With Quote #6

You completely misunderstand register_event.

The game has certain messages that the server sends to the client, such as Health. The server remembers your health, but the client has to know when to change it. So, the server sends the Health message to the client, the client receives it, and their health is updated on the HUD.

register_event catches these messages, or events, as they come from the server to the client. You can't make up your own like "Kill10" or "Death10".
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-20-2005 , 17:41  
Reply With Quote #7

so what should i use then
__________________
- Bye bye!
nightscreem is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-20-2005 , 18:17  
Reply With Quote #8

Code:
#include <amxmodx> #include <fun> #define SUPERSPEED      (1<<0) // 1 #define NINEKILL        (1<<1) // 2 new PlayerFlags[33] new PlayerFrags[33] public plugin_init() {     register_plugin("suprise", "1.0", "Nightscream")     register_logevent("new_round",2,"0=World triggered","1=Round_Start")     set_cvar_num("sv_maxspeed", 1000) } public new_round() {     new maxplayers = get_maxplayers()     new j     for(j=1; j <= maxplayers; j++)     {         new superspeedmsg[64]         new deaths = get_user_deaths(j)         new frags = get_user_frags(j)         format(superspeedmsg, 63, "[AMXX] You have superspeed for one round")         if ((deaths == 10) & (frags < 10))         {                 set_user_maxspeed(j, 1000.0)                 client_print(j ,print_chat, superspeedmsg)             PlayerFlags[j] += SUPERSPEED         }         else if(PlayerFlags[j] & SUPERSPEED)         {             set_user_maxspeed(j, -1.0)             client_print(j, print_chat, "[AMXX] Your SuperSpeed has ended.")             PlayerFlags[j] -= SUPERSPEED         }         if(frags == 9)         {             client_print(j, print_chat, "[AMXX] If you kill 1 person without get killed you get a suprise.")             PlayerFlags[j] += NINEKILL             PlayerFrags[j] += get_user_frags(j)         }         if(PlayerFlags[j] & NINEKILL) //&& PlayerFrags[j] += )         {             if(frags > PlayerFrags[j])             {                 set_user_maxspeed(j, 1000.0)                 client_print(j ,print_chat, superspeedmsg)                 PlayerFlags[j] += SUPERSPEED                 PlayerFlags[j] -= NINEKILL                 PlayerFrags[j] -= 9             }             else if(frags == PlayerFrags[j])             {                 PlayerFlags[j] -= NINEKILL                 PlayerFrags[j] -= 9             }         }     }     return PLUGIN_CONTINUE }

If someone see something wrong, Please feel free to edit it. I believe this should work.

Edited* 5:02pm 4/20/05
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-21-2005 , 10:12  
Reply With Quote #9

why looping?
and what do you mean with world triggered and round_start
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-21-2005 , 14:10  
Reply With Quote #10

Quote:
Originally Posted by nightscreem
why looping?
and what do you mean with world triggered and round_start
If you ever looked in console.. It says something like "World triggered. Round Start". Check out register_event() and register_logevent() in the function wiki.
__________________
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
Reply


Thread Tools
Display Modes

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