Raised This Month: $ Target: $400
 0% 

Spawn on connect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BeeT
Junior Member
Join Date: Aug 2010
Old 07-21-2011 , 10:28   Spawn on connect
Reply With Quote #1

Hello all, i would like to make a simple plugin.
Respawn player on connect, when player connected and selected team, he should be respawned. How to make it?

I have simple script, but it doesn't work all time, sometimes it's works sometimes no. And idk why...

Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <hamsandwich>
 
#define PLUGIN "Spawn on connect"
#define VERSION "1.0"
#define AUTHOR "aaarnas"
 
new client_validate[33]
 
public plugin_init()
    register_plugin(PLUGIN, VERSION, AUTHOR)
 
public client_connect(id)
    client_validate[id] = 0
 
public client_command(id) {
 
    new cmd[20]
    read_argv(0, cmd, charsmax(cmd))
   
    if(equal(cmd, "jointeam")) client_validate[id]++
    else if(equal(cmd, "joinclass")) client_validate[id]++
   
    if(client_validate[id] == 2) set_task(0.3, "spawn_player", id)
}
 
public spawn_player(id) if(!is_user_alive(id)) ExecuteHamB(Ham_CS_RoundRespawn, id)
BeeT is offline
 


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 01:10.


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