Raised This Month: $32 Target: $400
 8% 

respawn after x secs once


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-23-2007 , 20:46   respawn after x secs once
Reply With Quote #1

Hate maps that kill people on newround (worldspawn)??
This plugin respawns the ones who are dead after sv_worldspawntime seconds once and gives them a knife, pistol and extra $3000 bucks

cvar
sv_worldspawntime 3 //def 3, time to spawn after round start (freezetime over)
sv_worldspawnmoney 3000 //def 3000, extra money to give them when they are respawned
Attached Files
File Type: sma Get Plugin or Get Source (worldspawnspawn.sma - 806 views - 1.2 KB)
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME

Last edited by kp_uparrow; 01-30-2007 at 14:11.
kp_uparrow is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-23-2007 , 21:18   Re: respawn after x secs for worldspawn kill maps
Reply With Quote #2

I'm going to hurt the next person to include amxmisc unnecessarily...

Change modification to CS. Use pcvars. Use the get_players flags instead of checking in the loop (not talking about the team check). Redo the client_print (no spelling errors). Just do cs_set_user_money(id, get_user_money(id)+3000). Make a cvar for how much money to give them. Update the #define PLUGIN. Clean up the plugin description and topic title.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-23-2007 , 21:49   Re: respawn after x secs once
Reply With Quote #3

Code:
#include <amxmodx> #include <cstrike> #include <fun> #define PLUGIN "Respawn after x secs once" #define VERSION "1.0" #define AUTHOR "kp_uparrow" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("sv_worldspawntime","3")     register_cvar("sv_worldspawnmoney","3000")     register_logevent("logevent_round_start",2,"1=Round_Start") } public logevent_round_start(){     set_task(get_cvar_float("sv_worldspawntime"),"spawndead") } public spawndead(){     new players[32],num_of_players,num     get_players(players,num_of_players,"bh")     new addmoney = get_cvar_num("sv_worldspawnmoney")     for(new player = 0; player < num_of_players;  player++){         num = players[player]         if (is_user_alive(num)==0 && is_user_connected(num)==1 ){             if (cs_get_user_team(num)==CS_TEAM_T || cs_get_user_team(num)==CS_TEAM_CT){                                 spawn(num)                  set_task(0.1,"spawnagain",num,"",0)                 client_print(num,print_chat,"[NESPH] Dam! not enough spawn points, respawned you with extra %s money",addmoney)                                 new money = cs_get_user_money(num)                 cs_set_user_money(num,money+addmoney)             }         }     }     return PLUGIN_CONTINUE } public spawnagain(num){     spawn(num)     give_item(num,"weapon_knife")     if (get_user_team(num)==1){         give_item(num,"weapon_glock18")         give_item(num,"ammo_9mm")         give_item(num,"ammo_9mm")     }     else{                 give_item(num,"weapon_usp")         give_item(num,"ammo_45acp")         give_item(num,"ammo_45acp")     } }
first: which part of get_players do i change? i dont get what u mean by check loop (b and e?)
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME

Last edited by kp_uparrow; 01-23-2007 at 21:57.
kp_uparrow is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-23-2007 , 22:05   Re: respawn after x secs once
Reply With Quote #4

just 'b'. then you can take out the 'is_user_alive(num)==0'. Use pcvars. And just do cs_set_user_money(num, cs_get_user_money(num)+addmoney).
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 01-23-2007 , 22:07   Re: respawn after x secs once
Reply With Quote #5

Also, logevent round start happens at round freeze time end.

Change it to HLTV, which is when freeze time starts, because if I remember correctly, players can be killed by worldspawn while in freeze time.

If I'm wrong about the freeze time worldspawn, my bad...kinda tired.
organizedKaoS is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-23-2007 , 22:26   Re: respawn after x secs once
Reply With Quote #6

Code:
#include <amxmodx> #include <cstrike> #include <fun> #define PLUGIN "Respawn after x secs once" #define VERSION "1.0" #define AUTHOR "kp_uparrow" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("sv_worldspawntime","3")     register_cvar("sv_worldspawnmoney","3000")     register_logevent("HLTV",2,"1=Round_Start") } public logevent_round_start(){     set_task(get_cvar_float("sv_worldspawntime"),"spawndead") } public spawndead(){     new players[32],num_of_players,num     get_players(players,num_of_players,"bh")     new addmoney = get_cvar_num("sv_worldspawnmoney")     for(new player = 0; player < num_of_players;  player++){         num = players[player]         if (is_user_connected(num)==1){             if (cs_get_user_team(num)==CS_TEAM_T || cs_get_user_team(num)==CS_TEAM_CT){                                 spawn(num)                  set_task(0.1,"spawnagain",num,"",0)                 client_print(num,print_chat,"[NESPH] Dam! not enough spawn points, respawned you with extra %s money",addmoney)                 cs_set_user_money(num,cs_get_user_money(num)+addmoney)             }         }     }     return PLUGIN_CONTINUE } public spawnagain(num){     spawn(num)     give_item(num,"weapon_knife")     if (get_user_team(num)==1){         give_item(num,"weapon_glock18")         give_item(num,"ammo_9mm")         give_item(num,"ammo_9mm")     }     else{                 give_item(num,"weapon_usp")         give_item(num,"ammo_45acp")         give_item(num,"ammo_45acp")     } }
now pcvars, whats the difference <- noob question
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 01-23-2007 , 22:28   Re: respawn after x secs once
Reply With Quote #7

faster.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-23-2007 , 22:45   Re: respawn after x secs once
Reply With Quote #8

i add a p to every var?
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 01-23-2007 , 23:13   Re: respawn after x secs once
Reply With Quote #9

Read my comment..

http://www.amxmodx.org/funcwiki.php?..._num&go=search
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Trent-Resnor
Member
Join Date: Jan 2007
Location: Ontario, Canada
Old 01-23-2007 , 23:16   Re: respawn after x secs once
Reply With Quote #10

It's more efficient to use pcvar's then cvars. Start by reading some of the tutorials posted by VEN. and some other people
__________________

Last edited by Trent-Resnor; 01-23-2007 at 23:17. Reason: forgot VEN isn't the only one who makes tutorials :P
Trent-Resnor is offline
Send a message via MSN to Trent-Resnor
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 11:08.


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