Raised This Month: $ Target: $400
 0% 

Hit a wall, read through funcs and stuff before post


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Len
Senior Member
Join Date: Dec 2007
Old 12-31-2010 , 16:13   Re: Hit a wall, read through funcs and stuff before post
Reply With Quote #6

amxx took my API virginity , not so much now but the possibilities of what I'll be able to do with my favourite game!

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Basics"
#define VERSION "1.0"
#define AUTHOR "Hihiyoyo"
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /rules""rules")
    
register_clcmd("jointeam""block_jointeam")
}
public 
rules(id) {
    new 
message[1000]
    
read_argv(1message1000)
    
client_print(idprint_chat"%s : /rules"name)
    new 
name[31]
    
get_user_name(idname30)
    
client_print(idprint_chat"%s The rules are.."name)
    return 
PLUGIN_HANDLED
}
public 
block_jointeam(id) {
    
client_print(idprint_chat"test")
    
client_print(idprint_chat"team = %s"cs_get_user_team(id))
    
    if (
cs_get_user_team(id) != CS_TEAM_SPECTATOR && 
    !
cs_get_user_team(id) &&
    
cs_get_user_team(id) != CS_TEAM_UNASSIGNED) return PLUGIN_HANDLED
    
    
else {
    
    new 
team[2]
    
read_argv(1team1)
    
client_print(idprint_chat"0 = %s",  team[0])
    
    if (
team[0] == '1'cs_set_user_team(idCS_TEAM_T)
    
    else if (
team[0] == '2'cs_set_user_team(idCS_TEAM_CT)
    
    else 
cs_set_user_team(idCS_TEAM_SPECTATOR)

    }
    return 
PLUGIN_HANDLED

I did your suggestions and changed a few things like client_cmd which was just making endless loops :@
debug results:
test
team =
0 = 3
which tells me cs_get_user_team isn't returning anything at all, not what func wiki says, thank you so much wrecked

EDIT: Also, in jointeam use the argument of 1 to get the team #, as 0 is the actual jointeam command itself.
so team[0] = jointeam, team[1] = team, team[2] = null? my debug comes out fine with the team numbers though

Last edited by Len; 12-31-2010 at 16:20. Reason: slight mistake
Len is offline
 



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:12.


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