Raised This Month: $ Target: $400
 0% 

Spawn counter for each player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-24-2013 , 03:12   Re: Spawn counter for each player
Reply With Quote #1

Quote:
Originally Posted by alonelive View Post
Hello!
How can i count the spawns of player?


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new spawn_count

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""PlayerPostSpawn"1);
}

public 
PlayerPostSpawn(id)
{
    
spawn_count++ //This is a TOTAL counter.
    //I need a counter for each player (individual spawn counter).. spawn_count(id)++ ???
    
    
    //for example
    
if(spawn_count/*(id)*/ 5)
    {
        
cs_set_user_bpammo(idCSW_HEGRENADE2)
    }
    else
        
cs_set_user_bpammo(idCSW_HEGRENADE1)
    
//for example

change to this

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new spawn_count33 ];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""PlayerPostSpawn"1);
}

public 
PlayerPostSpawn(id)
{
    
spawn_countid ]++ 
    
    
    
//for example
    
if(spawn_countid ] > 5)
    {
        
cs_set_user_bpammo(idCSW_HEGRENADE2)
    }
    else
        
cs_set_user_bpammo(idCSW_HEGRENADE1)


__________________
Blizzard_87 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 16:18.


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