Raised This Month: $159 Target: $400
 39% 

Buy respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 08-31-2013 , 17:48   Buy respawn
Reply With Quote #1

Buy Respawn


.:: Functionality ::.

Allows players to buy respawn to return to play again, it is possible to set the price.

Converted my plugin for Sourcemod:

https://forums.alliedmods.net/showthread.php?p=1960942

.:: CVARs ::.
  • amxx_buyrespawn_enabled = 1/0 - plugin is enabled/disabled (def. 1)
  • amxx_buyrespawn_cost = 0-16000 - Set the price for the respawn (def. 500)
  • amxx_buyrespawn_per_round = 0-99 - Set the max respawns per round (def. 2)
  • amxx_buyrespawn_message = 1/0 plugin message is enabled/disabled (def. 1)
  • amxx_buyrespawn_version - current plugin version
.:: Commands ::.
  • !respawn
  • /respawn
.:: Changelog ::.
Spoiler


OFICIAL WORK WITH GAMES
  • Counter-Strike 1.6
  • Counter-Strike Condition Zero

.:: Credits ::.

Rodrigo286

I'm take little bit of code of one plugin made by Geesu.

Thanks and please comment !
Attached Files
File Type: sma Get Plugin or Get Source (buy_respawn.sma - 2232 views - 3.8 KB)
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM

Last edited by rodrigo286; 09-02-2013 at 10:29.
rodrigo286 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-31-2013 , 20:12   Re: Buy respawn
Reply With Quote #2

Why not save there current weapons on death and restore them on re spawning?
__________________
Blizzard_87 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-31-2013 , 20:45   Re: Buy respawn
Reply With Quote #3

PHP Code:
public LogEvent_RoundStart()
{
/*
    Loop get all players of server
*/
    
new players[32], pnum;
    
get_players(playerspnum);
    for(new 
0pnumi++)
    {
/*
    Set respawn uses to 0
*/
        
respawns[players[i]] = 0;
    }

You don't need a loop, just use arrayset(array, 0, sizeof(array))

PHP Code:
public client_disconnect(client)
{
/*
    Reset respawn uses on player disconnect
*/
    
respawns[client] = 0;

You can remove it, since you set it zero on connect.

PHP Code:
public player_spawn(parm[1])
{
/*
    Spawn player
*/
    
spawn(parm[0])

Use Ham to spawn players.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 08-31-2013 , 21:28   Re: Buy respawn
Reply With Quote #4

Quote:
Originally Posted by wickedd View Post
PHP Code:
public LogEvent_RoundStart()
{
/*
    Loop get all players of server
*/
    
new players[32], pnum;
    
get_players(playerspnum);
    for(new 
0pnumi++)
    {
/*
    Set respawn uses to 0
*/
        
respawns[players[i]] = 0;
    }

You don't need a loop, just use arrayset(array, 0, sizeof(array))

PHP Code:
public client_disconnect(client)
{
/*
    Reset respawn uses on player disconnect
*/
    
respawns[client] = 0;

You can remove it, since you set it zero on connect.

PHP Code:
public player_spawn(parm[1])
{
/*
    Spawn player
*/
    
spawn(parm[0])

Use Ham to spawn players.
Thanks for this tips, i updated the plugin on initial post.

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
BLacking98
Veteran Member
Join Date: Oct 2012
Location: California
Old 09-01-2013 , 09:46   Re: Buy respawn
Reply With Quote #5

GJ ^^
__________________
BLacking98 is offline
HalfLife
Senior Member
Join Date: Aug 2013
Location: I'll tell you later ;)
Old 09-02-2013 , 05:11   Re: Buy respawn
Reply With Quote #6

This plugin is nice. Should get approved
__________________
If you need any help regarding your HL Server, PM me and I can help you
My Tutorials:
How to install and use your SQL Database using AMX Mod X Plugins
HalfLife is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 09-02-2013 , 05:18   Re: Buy respawn
Reply With Quote #7

Tell me what you think will happen if I try and respawn as a spectator ;)
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-02-2013 , 05:36   Re: Buy respawn
Reply With Quote #8

You will respawn as spectator.
__________________
Kia is offline
BLacking98
Veteran Member
Join Date: Oct 2012
Location: California
Old 09-02-2013 , 07:40   Re: Buy respawn
Reply With Quote #9

Quote:
Originally Posted by Kia View Post
You will respawn as spectator.
AWWWWWW how did you resize my smiley ;D
__________________
BLacking98 is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 09-02-2013 , 08:09   Re: Buy respawn
Reply With Quote #10

Now the plugin checks if the player is spectator, to prevent bugs.

Thanks for help.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 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:22.


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