Raised This Month: $ Target: $400
 0% 

Help for a useful plugin?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 15:03   Re: Help for a useful plugin?
Reply With Quote #4

about the for loops. It's actually quite simple.

PHP Code:
new players[32]; // To hold the players id.
new pnum// The amount of players.
new tempid// To store the temporary player ids

get_players(playerspnum); // Counts the players

for(0pnumi++) 
{    
    
// i < pnum means as long as i smaller then the amount of players, it continues to loop
    
tempid players[i// store the temporary id in a var

    
if(!is_user_alive(tempid))// If he is dead, skip him
        
continue;

    
set_user_health(tempid100); // Just an example

Respawn thing:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#pragma semicolon 1

public plugin_init()
{
    
register_plugin("respawn""1.0""Drekes");
    
    
register_clcmd("say respawn""cmd_respawn");
}

public 
cmd_respawn(id)
{
    if(
get_user_team(id) != || get_user_team(id) != 2)
    {
        new 
userid get_user_userid(id);
        
        
server_cmd("amx_kick %i ^"Don't try to respawn when you are not in a team^"", userid);
        
        return PLUGIN_HANDLED;
    }
    
    ExecuteHamB(Ham_CS_RoundRespawn, id);
    
    return PLUGIN_HANDLED;

Not tested but should work
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 07-06-2010 at 15:10.
drekes is offline
Send a message via MSN to drekes
 



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 07:06.


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