Raised This Month: $ Target: $400
 0% 

Wierd respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Len
Senior Member
Join Date: Dec 2007
Old 01-03-2011 , 17:50   Wierd respawn
Reply With Quote #1

No armor or health showing, I tried with spawn(id) it does the same, think im missing something with ham respawn, help please

edit:
tried cs_set_user_armor and set_user_health after ExecuteHamB(Ham_CS_RoundRespawn, id) and putting a model for cs_set_user_team still the same problem, someone tell me how I sort this out :/..


PHP Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
 
#define PLUGIN "Fair Teams"
#define VERSION "1.0"
#define AUTHOR "Len"
 
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("jointeam""block_jointeam")
}
 
public 
block_jointeam(id) {
    new 
team[2]
    
read_argv(1team1)
    if (
access(idADMIN_IMMUNITY)) {
        if (
team[0] == '1'cs_set_user_team(idCS_TEAM_T)
        if (
team[0] == '2'cs_set_user_team(idCS_TEAM_CT)
        goto 
SPAWN_PLAYER
    
}
 
    if (
CS_TEAM_UNASSIGNED cs_get_user_team(id) < CS_TEAM_SPECTATOR) return PLUGIN_HANDLED
 
    
if (team[0] == '3') {
        
cs_set_user_team(id,CS_TEAM_SPECTATOR)
        return 
PLUGIN_HANDLED
    
}
 
    new 
iteam_balance[3], max_players
    team_balance
[team[0]] = 1
    max_players 
get_maxplayers()
 
    for (
1<= max_playersi++) {
        if (
cs_get_user_team(id) == CS_TEAM_Tteam_balance[0]++
        else if (
cs_get_user_team(id) == CS_TEAM_Tteam_balance[1]++
    }
 
    
team_balance[2] = team_balance[0] - team_balance[1]
 
    if ((
team_balance[2] < -1) || (team_balance[2] > 1)) {
        if (
team_balance[1] > team_balance[1]) cs_set_user_team(idCS_TEAM_T)
        else if (
team_balance[0] > team_balance[1]) cs_set_user_team(idCS_TEAM_CT)
        goto 
SPAWN_PLAYER
    
}
 
    if ((
team[0] == '1') && (cs_get_user_team(id) != CS_TEAM_T)) cs_set_user_team(idCS_TEAM_T)
    else if ((
team[0] == '2') && (cs_get_user_team(id) != CS_TEAM_CT)) cs_set_user_team(idCS_TEAM_CT)
 
    
SPAWN_PLAYER:
 
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    return 
PLUGIN_HANDLED


Last edited by Len; 01-03-2011 at 19:47.
Len is offline
Len
Senior Member
Join Date: Dec 2007
Old 01-05-2011 , 11:30   Re: Wierd respawn
Reply With Quote #2

Come on I'm new to pawn and amxmodx, this script I have made compiles fine and works, just the spawning is crap... buggy death effect, no visable health, round time or armor.

I'm sorry for bumping but I want a answer, I don't know why people haven't replied I also tried IRC but no one is active..
Len is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-05-2011 , 11:52   Re: Wierd respawn
Reply With Quote #3

PHP Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
 
#define PLUGIN "Fair Teams"
#define VERSION "1.0"
#define AUTHOR "Len"
 
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("jointeam""block_jointeam")
}
 
public 
block_jointeam(id) {
    new 
team[2]
    
read_argv(1team1)
    if (
access(idADMIN_IMMUNITY)) {
        if (
team[0] == '1'cs_set_user_team(idCS_TEAM_T)
        if (
team[0] == '2'cs_set_user_team(idCS_TEAM_CT)
        
SPAWN_PLAYER(id);
    }
 
    if (
CS_TEAM_UNASSIGNED cs_get_user_team(id) < CS_TEAM_SPECTATOR) return PLUGIN_HANDLED
 
    
if (team[0] == '3') {
        
cs_set_user_team(id,CS_TEAM_SPECTATOR)
        return 
PLUGIN_HANDLED
    
}
 
    new 
iteam_balance[3], max_players
    team_balance
[team[0]] = 1
    max_players 
get_maxplayers()
 
    for (
1<= max_playersi++) {
        if (
cs_get_user_team(id) == CS_TEAM_Tteam_balance[0]++
        else if (
cs_get_user_team(id) == CS_TEAM_Tteam_balance[1]++
    }
 
    
team_balance[2] = team_balance[0] - team_balance[1]
 
    if ((
team_balance[2] < -1) || (team_balance[2] > 1)) {
        if (
team_balance[1] > team_balance[1]) cs_set_user_team(idCS_TEAM_T)
        else if (
team_balance[0] > team_balance[1]) cs_set_user_team(idCS_TEAM_CT)
    }
 
    if ((
team[0] == '1') && (cs_get_user_team(id) != CS_TEAM_T)) cs_set_user_team(idCS_TEAM_T)
    else if ((
team[0] == '2') && (cs_get_user_team(id) != CS_TEAM_CT)) cs_set_user_team(idCS_TEAM_CT)
 
    return 
PLUGIN_HANDLED
}  

SPAWN_PLAYER(id)
    
ExecuteHamB(Ham_CS_RoundRespawnid); 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Len
Senior Member
Join Date: Dec 2007
Old 01-05-2011 , 11:56   Re: Wierd respawn
Reply With Quote #4

im looking for a explanation drekes
edit: and does that make a custom function and what is the meaning of ;? I'm guessing it means PLUGIN_HANDLED?
Quote:
SPAWN_PLAYER(id)
ExecuteHamB(Ham_CS_RoundRespawn, id);

Last edited by Len; 01-05-2011 at 12:09.
Len is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-05-2011 , 13:00   Re: Wierd respawn
Reply With Quote #5

Quote:
Originally Posted by Len View Post
im looking for a explanation drekes
edit: and does that make a custom function and what is the meaning of ;? I'm guessing it means PLUGIN_HANDLED?
; = end of line

Quote:
Originally Posted by http://www.compuphase.com/pawn/pawnfeatures.htm
In pawn, semicolons to end a line are optional. It is common practice to write no more than one instruction per line, but if one does, he or she must still use the semicolon to separate two instructions on a line.
PLUGIN_HANDLED is a return value (I think it was defined as 1).


Just from a quick look drekes has replaced your label with a function and your gotos with calling the function... but seems to have forgotten to add a return afterwards? Anyway, wouldn't it be easier to just replace the gotos with
PHP Code:
ExecuteHamB(Ham_CS_RoundRespawnid)
return 
PLUGIN_HANDLED 
It's a single line function with no other purpose, with what drekes did

EDIT: Also, the spawn after
PHP Code:
else if (team_balance[0] > team_balance[1]) cs_set_user_team(idCS_TEAM_CT
was taken out... I'm too tired to think about why

Last edited by Elusive138; 01-05-2011 at 13:17.
Elusive138 is offline
Len
Senior Member
Join Date: Dec 2007
Old 01-05-2011 , 13:38   Re: Wierd respawn
Reply With Quote #6

with that in mind, it has to of been the goto and thanks for the help elusive
Len 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 02:09.


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