AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Commands Don't Execute (https://forums.alliedmods.net/showthread.php?t=127695)

GXLZPGX 05-23-2010 19:06

Commands Don't Execute
 
PHP Code:

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""user_connect")
    
register_clcmd("say /guns""WeaponMenu"ADMIN_USER)
}

public 
user_connect(id)
{
    if(
is_user_alive(id)) {
        new 
CsTeams:team cs_get_user_team(id);
        if(
team == CS_TEAM_T)
        {
            
fm_strip_user_weapons(id);
            
give_item(id"weapon_knife");
            
ColorChat(id"^4%s^1As a terrorist, you will be a ninja!");
            
fm_set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha25);
            
fm_set_user_health(id200);
            
fm_set_user_gravity(id0.5);
            
fm_set_user_maxspeed(id375.0);
            
ColorChat(id"^4%s^1Your objective is to kill all humans, good luck!");
        }
        if(
team == CS_TEAM_CT)
        {
            
ColorChat(id"^4%s^1As a counter-terrorist, you will be a human!");
            
fm_set_user_rendering(idkRenderFxGlowShell255255255kRenderTransAlpha125);
            
set_task(1.0"WeaponMenu");
            
ColorChat(id"^4%s^1Your objective is to kill the ninjas, good luck!");
        }
    }


Whats wrong here? It wont display the messages or execute anything.

Kreation 05-23-2010 19:30

Re: Commands Don't Execute
 
Why not just take the fm_ away from all the functions?

FlyingHorse 05-23-2010 19:50

Re: Commands Don't Execute
 
PHP Code:

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""user_connect")
    
register_clcmd("say /guns""WeaponMenu"ADMIN_USER)
}

public 
user_connect(id)
{
    if(
is_user_alive(id)) {
        new 
CsTeams:team cs_get_user_team(id);
        if(
team == CS_TEAM_T)
        {
            
strip_user_weapons(id);
            
give_item(id"weapon_knife");
            
ColorChat(id"^4%s^1As a terrorist, you will be a ninja!");
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha25);
            
set_user_health(id200);
            
set_user_gravity(id0.5);
            
set_user_maxspeed(id375.0);
            
ColorChat(id"^4%s^1Your objective is to kill all humans, good luck!");
        }
        if(
team == CS_TEAM_CT)
        {
            
ColorChat(id"^4%s^1As a counter-terrorist, you will be a human!");
            
set_user_rendering(idkRenderFxGlowShell255255255kRenderTransAlpha125);
            
set_task(1.0"WeaponMenu");
            
ColorChat(id"^4%s^1Your objective is to kill the ninjas, good luck!");
        }
    }



JaGareN 05-23-2010 19:55

Re: Commands Don't Execute
 
Quote:

Originally Posted by Kreation (Post 1189317)
Why not just take the fm_ away from all the functions?

He maybe want to use fakemeta?

EDIT: the colorchat messages are wrong.

Exolent[jNr] 05-23-2010 19:58

Re: Commands Don't Execute
 
Those fm_ functions are less efficient than the ones they are replacing.

JaGareN 05-23-2010 20:12

Re: Commands Don't Execute
 
Quote:

Originally Posted by Exolent[jNr] (Post 1189341)
Those fm_ functions are less efficient than the ones they are replacing.

What do you mean?

GXLZPGX 05-23-2010 20:25

Re: Commands Don't Execute
 
Quote:

Originally Posted by JaGareN (Post 1189339)
He maybe want to use fakemeta?

EDIT: the colorchat messages are wrong.

No, the ColorChat message are fine. I used my own custom stock for colorchat. Now everything works, except it wont set the speed.

Exolent[jNr] 05-23-2010 20:32

Re: Commands Don't Execute
 
Quote:

Originally Posted by JaGareN (Post 1189347)
What do you mean?

http://forums.alliedmods.net/showthread.php?t=88792

GXLZPGX 05-23-2010 21:55

Re: Commands Don't Execute
 
Quote:

Originally Posted by Exolent[jNr] (Post 1189353)

Your link the the "New Round / Player Spawn / Round Start / Round End" did not change anything.

fysiks 05-23-2010 21:57

Re: Commands Don't Execute
 
Quote:

Originally Posted by GXLZPGX (Post 1189402)
Your link the the "New Round / Player Spawn / Round Start / Round End" did not change anything.

I don't know where you got that from.

That link is not for "New Round / Player Spawn / Round Start / Round End". It is titled "[TUT] Modules and efficient scripting".


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

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