Raised This Month: $ Target: $400
 0% 

error in my plugin, please help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
skulldiggers
Member
Join Date: Sep 2004
Old 12-29-2004 , 02:41  
Reply With Quote #3

ok, i changed the code to

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

new rdys=0, rdy[32], inmatch=0, ativo=0
new g_teamScore[2] 

public ready_to_match(id)
{
       new kName[32]
       get_user_name(id,kName,31)
       new Float:minrdys= get_cvar_float("amx_rdys")

       if(ativo)
       {
       if(!inmatch)
       {
       if(!rdy[id])
       {
                client_print(0,print_chat,"** %s esta Pronto para a partida **", kName)
                rdy[id]=1
                rdys++
       }
       else
       {
                client_print(id,print_chat,"** Voce Ja deu ready! **")
                return PLUGIN_CONTINUE
       }

       if(rdys>=minrdys)
       {
       inmatch=1
       set_task(2.0, "start_the_match")
       }
       }
       }
       else
       {
       client_print(id,print_chat,"** CPL MATCH ESTA DESATIVADA **")
       }
       return PLUGIN_CONTINUE
}

public restart_round(time[])
{
  server_cmd("sv_restartround %s",time)
  return PLUGIN_CONTINUE
}

public restart_msg2()
{
        new host[32]
        get_cvar_string("hostname",host,32)
        client_print(0,print_chat,"%s : [--- LIVE ON NEXT RESTART ---]", host)
        return PLUGIN_CONTINUE
}

public restart_msg3()
{
        new host[32]
        get_cvar_string("hostname",host,32)
        client_print(0,print_chat,"%s : [--- LIVE! LIVE! LIVE! ---]", host)
        return PLUGIN_CONTINUE
}

public say_algo(msg[])
{
        new host[32]
        get_cvar_string("hostname",host,32)
        client_print(0,print_chat,"%s : %s", host, msg)
        return PLUGIN_CONTINUE
}

public start_the_match()
{
        new cfgfile[64]
        new host[32]
        get_cvar_string("hostname",host,32)
        server_cmd("exec %s", cfgfile)
        client_print(0,print_chat,"%s : [--- LIVE IN 3 RESTARTS ---]", host)
        restart_round("1")
        set_task(1.0, "restart_round",0,"1",2)
        set_task(3.0, "restart_msg2")
        set_task(2.0, "restart_round",0,"10",2)
        set_task(13.0, "restart_msg3")
}

public match_info(id)
{
        new Float:minrdys= get_cvar_float("amx_rdys")
        client_print(id,print_chat,"** Faltam %s dizer !rdy para comecar a partida **", minrdys - rdys)
        log_amx("%s Rdys",rdys)
        return PLUGIN_CONTINUE
}

public amx_startmatch(id,level,cid)
{
    restart_round("1")
    set_task(1.5, "restart_round",0,"1",2)
    set_task(3.0, "restart_round",0,"5",2)
    set_task(3.0, "last_rr")
    set_task(9.0, "lmessage")
    return PLUGIN_HANDLED
}

public amx_match(id,level,cid)
{
	if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED

	new type[32]
	read_argv(1, type, 32)
	if (equal(type,"0")) {
	ativo=0
	server_cmd("exec 4fun.cfg")
	}
	if (equal(type,"1")) {
	ativo=1
	server_cmd("exec cpl.cfg")
	}
	if (equal(type,"2")) {
	ativo=1
	server_cmd("exec cplot.cfg")
	}
    return PLUGIN_HANDLED
}

public teamScore(id) { 
    new team[2] 
    read_data(1,team,1) 
    g_teamScore[(team[0]=='C')? 0 : 1] = read_data(2) 

    return PLUGIN_CONTINUE 
} 

public showthescore()
{
if (ativo)
{
new the_score[64]
format(the_score,1023,"CT %s x %s TR",g_teamScore[0], g_teamScore[1])
set_hudmessage(255, 0, 0, -1.0, 0.32, 0, 2.0, 6.0, 0.8, 0.8, 2)
show_hudmessage(0,the_score)
}
}


public plugin_init()
{
        register_plugin("Cpl Match auto prepare","1.0a","Tr4NInG")
        register_clcmd( "say !rdy", "ready_to_match", 0, "Ready to match" )
        register_clcmd( "say !info", "match_info", 0, "Info of number of readys" )
        register_concmd("amx_match", "amx_match",ADMIN_MAP,"Start or stop a match in server")
        register_cvar("amx_rdys","10")
        register_event("TeamScore", "teamScore", "ab") 
        register_event("ResetHUD", "showthescore", "b")
}
but in
Code:
public match_info(id)
{
        new Float:minrdys= get_cvar_float("amx_rdys")
        client_print(id,print_chat,"** Faltam %s dizer !rdy para comecar a partida **", minrdys - rdys)
        log_amx("%s Rdys",rdys)
        return PLUGIN_CONTINUE
}
and

Code:
public showthescore()
{
if (ativo)
{
new the_score[64]
format(the_score,1023,"CT %s x %s TR",g_teamScore[0], g_teamScore[1])
set_hudmessage(255, 0, 0, -1.0, 0.32, 0, 2.0, 6.0, 0.8, 0.8, 2)
show_hudmessage(0,the_score)
}
}
have any error because dont show the numbers

only CT x TR or

** Faltam dizer !rdy para comecar a partida **

dont show the numbers..

help me because is my first plugin
__________________
Headshot rules...
skulldiggers 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 00:29.


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