AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need small help (https://forums.alliedmods.net/showthread.php?t=236754)

code 03-10-2014 16:33

Need small help
 
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "I'm Simon"
#define VERSION "1.0"
#define AUTHOR "SpeeD"

new bool:Simon
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /simon","simoncmd")
register_logevent("ResetSimon",2,"1=Round_End ")
register_event("TextMsg", "ResetSimon", "a", "2&#Game_C", "2&#Game_w")
}

public simoncmd(id)
{
if(get_user_team(id) != 2)
ColorChat(id,GREEN,"You are not allowed to be Simon.")
if(!Simon)
{
new name[32]
get_user_name(id,name,31)
set_hudmessage( 0, 100, 255, 1.0, 0.05, 0, 0.1, 1.0, 0.1, 0.1, 4 );
show_hudmessage( 0, "%s - Is now simon.", name );
Simon = true
return PLUGIN_HANDLED;
}
else
ColorChat(id,GREEN,"There is already Simon!")
return PLUGIN_HANDLED
}

public ResetSimon()
Simon = false

Hud message disappears how i can make so it stays until next round

Please help :( i dont ask much :(

YamiKaitou 03-10-2014 16:42

Re: Need small help
 
Increase the holdtime (parameter 8)

code 03-10-2014 16:58

Re: Need small help
 
Thanks now works perfect :)

code 03-10-2014 17:54

Re: Need small help
 
another problem came up i have another plugin who uses command /simon now the second plugin dosent detect it. Is there a way so /simon command actiwates two plugins at same time?

i use jailbreak mod

YamiKaitou 03-10-2014 18:01

Re: Need small help
 
You need to return either PLUGIN_HANDLED_MAIN (prevents chat message from displaying) or PLUGIN_CONTINUE (displays chat message) in both plugins in the command handle function

code 03-10-2014 18:02

Re: Need small help
 
Thanks

code 03-11-2014 09:05

Re: Need small help
 
Another problem when Simon dies he won't disappear from HUD how to fix that
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Simon"
#define VERSION "1.0"
#define AUTHOR "Frego"

new bool:Simon
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /simon","simoncmd")
    register_logevent("ResetSimon",2,"1=Round_End")
    register_event("TextMsg", "ResetSimon", "a", "2&#Game_C", "2&#Game_w")
}

public simoncmd(id)
{
    if(get_user_team(id) != 2)
        ColorChat(id,GREEN,"You are T ;).")
    if(!Simon)
    {
        new name[32]
        get_user_name(id,name,31)
        set_hudmessage( 255, 204, 0, 1.0, 0.05, 0, 0.1, 900.0, 0.1, 0.1, 4 );
        show_hudmessage( 0, "%s - is Simon.", name );
        Simon = true
    }
    else
        ColorChat(id,GREEN,"There is already simon!")
    return PLUGIN_HANDLED_MAIN
}

public ResetSimon()
    Simon = false


connoisseur 03-11-2014 10:07

Re: Need small help
 
You'll have to code in the condition for when the simon dies. Right now it will display the HUD for full 900 seconds no matter what.
You can display a message on the same channel to make the previous message disappear.

Also, try to make your topic headings descriptive.

code 03-12-2014 17:41

Re: Need small help
 
Nop it displays Hud until round restart. But after death it wont disapear :(.
if name is d... then goto s which is in the beginning but i dont know how to write it wright.
Probably im stupid and i dont know anything about c because now i'm learning pascal and qbasic so help me out afther 4 years i will help you :D


All times are GMT -4. The time now is 05:55.

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