AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I have error (https://forums.alliedmods.net/showthread.php?t=134832)

zirualas 08-09-2010 09:10

I have error
 
I try to do hud messege what show how much time lef to play.
That's my error.
PHP Code:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// timelimit.sma
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\timelimit.sm
a(16) : warning 217loose indentation
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\timelimit.sm
a(16) : error 029invalid expressionassumed zero
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\timelimit.sm
a(16) : error 017undefined symbol "Timelimite"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\timelimit.sm
a(18) : error 017undefined symbol "id"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\timelimit.sm
a(19) : error 029invalid expressionassumed zero
//
// 4 Errors.
// Could not locate output file C:\Program Files\Counter-strike\cstrike\addons\a
mxmodx\scripting\compiled\timelimit.amx (compile failed).
//
// Compilation Time: 0.08 sec
// ----------------------------------------

Press enter to exit ... 

That's my code
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Timelimit"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"


public client_init()
{
    
register_clcmd"say time""Timelimite" ); 
    
register_clcmd"say /time""Timelimite" );
    
register_clcmd"say_team time""Timelimite" );  
    
register_clcmd"say_team /time""Timelimite" );  

public 
Timelimiteid )
{
    if( 
is_user_aliveid ))
    
set_hudmessage(2002552550.700.006.0,)
}



DarkGod 08-09-2010 09:52

Re: I have error
 
Something like this...

Code:
#include <amxmodx> #define PLUGIN "Timelimit" #define VERSION "1.0" #define AUTHOR "ZiruAl" new timelimit public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd( "say time", "Timelimite" );     register_clcmd( "say /time", "Timelimite" );     register_clcmd( "say_team time", "Timelimite" );       register_clcmd( "say_team /time", "Timelimite" );         timelimit = get_cvar_pointer("mp_timelimit") } public Timelimite( id ) {     if( is_user_alive( id ))     {         set_hudmessage(200, 255, 255, 0.70, 0.0, 0, 6.0)         show_hudmessage(id, "Timeleft: %i", get_pcvar_num(timelimit) - floatround(get_gametime() / 60)  )     } }

zirualas 08-09-2010 11:04

Re: I have error
 
Thank you :).
Now 1 more question how i can do it shows not time limit but show's task time. Etc. My player select a no clip for 5 seconds and hud shows hhow much time he have :).

Mxnn 08-09-2010 15:23

Re: I have error
 
You have to do a countdown.

zirualas 08-10-2010 03:35

Re: I have error
 
What's command of this "Countdown".
I search in amxmodx.org, nothing

drekes 08-10-2010 06:17

Re: I have error
 
here is explained how to make a countdown:
http://forums.alliedmods.net/showthread.php?t=130616

zirualas 08-10-2010 06:33

Re: I have error
 
I don't undestond, how i can do this effect when I type /time .

Mxnn 08-10-2010 22:01

Re: I have error
 
This works perfectly:
PHP Code:

public CountDown(id) {
if (
is_user_connected(id)) {
        
set_hudmessage(147147147, -1.00.8116.01.50.20.21)
        
        if (
respawn_counter[id] > 
        
show_hudmessage(id"Finish in %i seconds"respawn_counter[id])
    
        if (
respawn_counter[id] == 0) {
            
// The countdown finish
            
respawn_counter[id] = 5
        
}    
        else {
            
set_task(0.9"CountDown"id)
            
respawn_counter[id]--
        }    
    }
    
    return


Change messages & stuff

respawn_counter[] is a global var with 33 cells (1 for each player)


All times are GMT -4. The time now is 00:16.

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