AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Conversion problem (https://forums.alliedmods.net/showthread.php?t=3763)

hellraser 07-13-2004 21:12

Conversion problem
 
Hey all,have been trying to convert this amx plugin but doesnt work right...
May someone help me out plz:
Code:

#include <amxmodx>
#include <file>

public plugin_init()  {
        register_plugin("Display rules on connect","1.00","[TeamHoward]PapaSmurf")
        register_cvar("mp_displaytime","30.0",4 )
        register_cvar("mp_red","255.0",4 )
        register_cvar("mp_green","0.0",4 )
        register_cvar("mp_blue","0.0",4 )
        register_clcmd("say /rules","rules")
        register_clcmd("say_team /rules","rules")
        return PLUGIN_CONTINUE
}

public client_connect(id)  {
        set_task(20.0,"rules",id,"",0,"",0)
        client_cmd( id, "say OK" );
}

public rules(id)  {
        new line[80], len, Lines = 0
        new rulesTable[1280]
        new Float:displaytime = get_cvar_float("mp_displaytime")
        new red = get_cvar_num("mp_red")
        new green = get_cvar_num("mp_green")
        new blue = get_cvar_num("mp_blue")
        while (read_file("addons/amxx/custom/rules.txt", Lines++, line, 79, len))  {
                format(line, 79,"%s^n",line)
                add(rulesTable,1279,line)
        }
        set_hudmessage( red,green,blue, 0.028, 0.125, 2, 0.02,displaytime, 0.01, 0.1, 4 )
        show_hudmessage( id,rulesTable )
        return PLUGIN_HANDLED
}

Thx

Burnzy 07-13-2004 21:21

u dont need the file include

hellraser 07-14-2004 05:55

hum okey but still doesn't work correctly :/
Its displays the message before i select a team the when i choose T or CT the message disapears..
And when i type "say /rules" it just disconnects me from the server :/

Dygear 07-14-2004 06:42

It compiled fine for me, when i removed the "#include <file>"
Try testing it out with out file being included.

hellraser 07-14-2004 08:21

yes compiles fine but then on STEAM/1.6 doesnt work correctly...

BAILOPAN 07-14-2004 08:54

You have to say WHAT doesn't work!

hellraser 07-14-2004 09:19

i did:
1]When i connect the messages shows well before i select a team then it disapears
2] when i type /rules i get disconnected from the servers !

Thx

QwertyAccess 07-14-2004 16:59

how can you get disconnected by saying /rules does it say overflow or anything? or what.

hellraser 07-14-2004 18:12

says aboslutely nothing :/
This plugin was at the beginning an NS plugin

Johnny got his gun 07-15-2004 03:50

I dont think displaying the stuff 20 seconds after client_connect is a good idea. I suggest you start off from client_putinserver instead, then add like 5-10 seconds to that. 20 seconds is probably way too short a time and those that precache the map/soundfiles/other files will never see it.


All times are GMT -4. The time now is 14:48.

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