Raised This Month: $ Target: $400
 0% 

If a player join late


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-22-2007 , 05:15   Re: If a player join late
Reply With Quote #1

Oh right, now I'm with you.

For some reason I thought you just wanted the time upped slightly, but really you want everyone to get the plugin.

In *that* case ... gimme a little time and I'll slightly rewrite it.

EDIT: Try this one for size:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <fakemeta> #define TIME_TO_WAIT 2.0 #define TASK_ID 2796 public plugin_init() {     register_forward(FM_Spawn,"on_spawn",1) } public main_func(const taskid) {     new player = taskid - TASK_ID ;     if ( is_user_alive(player) )     {         new health = get_user_health(player);         if(random_num(0, 100) <= 1)         {                       give_item(player, "weapon_scout")                         cs_set_user_bpammo(player, CSW_SCOUT, 0)             client_print(player, print_chat, "[Lottery] you just won a scout with 1 bullet (1 percent chance)")         }                 if(random_num(0, 100) <= 2)         {             give_item(player, "weapon_deagle")                          cs_set_user_bpammo(player, CSW_DEAGLE, 0)             client_print(player, print_chat, "[Lottery] you just won a deagle with 1 bullet (2 percent chance)")         }                 if(random_num(0, 100) <= 15)         {             give_item(player, "weapon_hegrenade")             client_print(player, print_chat, "[Lottery] you just won a HE-grenade (15 percent chance)")         }                 if(random_num(0, 100) <= 10)         if (cs_get_user_team(player) == CS_TEAM_T)         {             give_item(player, "weapon_shield")             client_print(player, print_chat, "[Lottery] you just won a shield (10 percent chance)")         }                 if(random_num(0, 100) <= 1)         {             health += 100;             set_user_health(player,health);               client_print(player, print_chat, "[Lottery] you just won 100 extra health (1 percent chance)")         }         if(random_num(0, 100) <= 5)         {             health += 50;             set_user_health(player,health);               client_print(player, print_chat, "[Lottery] you just won 50 extra health (5 percent chance)")         }         if(random_num(0, 100) <= 10)         {             health += 25;             set_user_health(player,health);               client_print(player, print_chat, "[Lottery] you just won 25 extra health (10 percent chance)")         }         if(random_num(0, 100) <= 25)         {             cs_set_user_armor(player, 100, CS_ARMOR_VESTHELM)               client_print(player, print_chat, "[Lottery] you just won a kevlar and helmet (25 percent chance)")         }     } } public on_spawn(id) {     set_task(TIME_TO_WAIT, "main_func",TASK_ID+id) }

Last edited by purple_pixie; 11-22-2007 at 06:19.
purple_pixie is offline
Claw
Member
Join Date: Sep 2004
Old 11-22-2007 , 08:41   Re: If a player join late
Reply With Quote #2

Ehm is it only me, or is it not possible to copy it? When i copy it from here it get's like this:
Code:
 #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <fakemeta> #define TIME_TO_WAIT 2.0 #define TASK_ID 2796 public plugin_init() {     register_forward(FM_Spawn,"on_spawn",1) } public main_func(const taskid) {     new player = taskid - TASK_ID ;     if ( is_user_alive(player) )     {         new health = get_user_health(player);         if(random_num(0, 100) <= 1)         {                      give_item(player, "weapon_scout")                         cs_set_user_bpammo(player, CSW_SCOUT, 0)             client_print(player, print_chat, "[Lottery] you just won a scout with 1 bullet (1 percent chance)")         }                 if(random_num(0, 100) <= 2)         {             give_item(player, "weapon_deagle")                          cs_set_user_bpammo(player, CSW_DEAGLE, 0)             client_print(player, print_chat, "[Lottery] you just won a deagle with 1 bullet (2 percent chance)")         }                 if(random_num(0, 100) <= 15)         {             give_item(player, "weapon_hegrenade")             client_print(player, print_chat, "[Lottery] you just won a HE-grenade (15 percent chance)")         }                 if(random_num(0, 100) <= 10)         if (cs_get_user_team(player) == CS_TEAM_T)         {         give_item(player, "weapon_shield")       client_print(player, print_chat, "[Lottery] you just won a shield (10 percent chance)")         }                 if(random_num(0, 100) <= 1)         {             health += 100;             set_user_health(player,health);              client_print(player, print_chat, "[Lottery] you just won 100 extra health (1 percent chance)")         }         if(random_num(0, 100) <= 5)         {             health += 50;             set_user_health(player,health);              client_print(player, print_chat, "[Lottery] you just won 50 extra health (5 percent chance)")         }         if(random_num(0, 100) <= 10)         {             health += 25;             set_user_health(player,health);              client_print(player, print_chat, "[Lottery] you just won 25 extra health (10 percent chance)")         }         if(random_num(0, 100) <= 25)         {             cs_set_user_armor(player, 100, CS_ARMOR_VESTHELM)                client_print(player, print_chat, "[Lottery] you just won a kevlar and helmet (25 percent chance)")         }     } } public on_spawn(id) {     set_task(TIME_TO_WAIT, "main_func",TASK_ID+id) }
And then it's not possible to compile, could you maybe compile it for me? ^^

Last edited by Claw; 11-22-2007 at 09:04.
Claw is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-22-2007 , 10:28   Re: If a player join late
Reply With Quote #3

register_plugin()?
It's you.

Last edited by [ --<-@ ] Black Rose; 11-22-2007 at 10:30.
[ --<-@ ] Black Rose 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 01:16.


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