Raised This Month: $ Target: $400
 0% 

Is The Compiler Racist?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-05-2010 , 15:53   Is The Compiler Racist?
Reply With Quote #1

Well, I've been modifying this plugin on and off for the past day or two, and I implemented ColorChat but it seems for some reason, when I do this, the compiler doesn't pick up my Ham Registries.

Here's the code, line 1 to the end.
PHP Code:
/*       Grenade Slaps @ wrecked

    Personal Hungarian Notation:
    pl_    = Player Index
    pCvar_    = PCvar...
    reg_    = Engine registry
    hfw_    = Ham Forward
    e_    = Entity
    
    Credits:
    Exolent[jNr]     - Help with the unit conversion and the idea
    r4nd0mz        - Original and simple idea
    
    Changelog:
    v0.1.0        - Plugin start + Dumb user_slap command
    v0.1.1        - Distance calculator + ColorChat
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>
#include <fun>

enum Color
{
    
NORMAL 1,
    
GREEN,
    
TEAM_COLOR,
    
GREY,
    
RED,
    
BLUE,
}

new const 
VERSION[] = "0.0.1"

// Pcvars
new pCvar_SlapDmg
new pCvar_Prefix

// Origins
new Float:f_ThrowOrigin]
new 
Float:f_HitOrigin]
new 
Float:f_SlapVelocity]

// Player names
new sz_ThrowerName64 ]

new 
pl_Owner

new ownerTeam

public plugin_init()
{
    
register_plugin("Grenade Slap"VERSION"wrecked"// <--- This guy's cool
    
    
pCvar_SlapDmg register_cvar"gs_damage""25" )
    
pCvar_Prefix register_cvar"gs_prefix""[NADE]" )
    
    
register_touch"grenade""player""reg_NadeTouch" // When it hits the reciever
    
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_hegrenade""hfw_NadeThrow"// If the user throws a nade, we get the origin of it in the function
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_flashbang""hfw_NadeThrow")
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_smokegrenade""hfw_NadeThrow")
}

public 
reg_NadeTouche_NadeHitpl_Receiver )
{
    new 
hitTeam cs_get_user_teampl_Receiver )
    
    if( 
ownerTeam == hitTeam )
    {
        return;
    }
    else
    {
    
peve_NadeHitpev_originf_HitOrigin // Get the origin of the nade as it hits the reciever, pl_Player
    
    
new iHealth get_user_healthpl_Receiver )
    
    new 
sz_ReceiverName64 ]
    
get_user_namepl_Receiversz_ReceiverNamecharsmaxsz_ReceiverName ) )
    
    new 
Float:f_NadeDistance get_distance_ff_ThrowOriginf_HitOrigin // Get the distance
    
    
f_SlapVelocity[0] = f_NadeDistance * ( random_num(0,1) ? 1.0 : -1.0 // Set velocity of the slap based on the distance
    
f_SlapVelocity[1] = f_NadeDistance * ( random_num(0,1) ? 1.0 : -1.0 )
    
f_SlapVelocity[2] = f_NadeDistance * ( random_num(0,1) ? 1.0 : -1.0 )
    
    
set_user_healthpl_ReceiveriHealth get_pcvar_numpCvar_SlapDmg ) ) // Slap damage
    
    
set_pevpl_Receiverpev_velocityf_SlapVelocity // Blast off!
    
    
if( f_NadeDistance 499.9 )
    {
        
ColorChat0RED"%s Wow! %s just hit %s with a nade from %f units away!"pCvar_Prefixsz_ThrowerNamesz_ReceiverNamef_NadeDistance )
    }
}

public 
hfw_NadeThrowe_NadeThrown )
{
    
peve_NadeThrownpev_originf_ThrowOrigin // Get the origin of the nade right as it is thrown
    
    
peve_NadeThrownpev_ownerpl_Owner // Get ID of player who throws the nade
    
    
ownerTeam cs_get_user_teampl_Owner // His team
    
    
get_user_namepl_Ownersz_ThrowerNamecharsmaxsz_ThrowerName ) ) // His name
}

stock ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }

and here are the errors that I get when trying to compile:
Code:
/home/groups/amxmodx/tmp3/phpe35uKY.sma(73) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpe35uKY.sma(98) : error 017: undefined symbol "ColorChat"
/home/groups/amxmodx/tmp3/phpe35uKY.sma(102) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/phpe35uKY.sma(102) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpe35uKY.sma(102) : error 017: undefined symbol "hfw_NadeThrow"
/home/groups/amxmodx/tmp3/phpe35uKY.sma(104) : error 017: undefined symbol "e_NadeThrown"
/home/groups/amxmodx/tmp3/phpe35uKY.sma(104) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpe35uKY.sma(104) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpe35uKY.sma(104) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpe35uKY.sma(104) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpe35uKY.sma(104) : fatal error 107: too many error messages on one line

Compilation aborted.
I seem to recall my friend saying that the compiler doesn't have colorchat included, but I figured it wouldn't have any effect on the stock. Could it be that? If it is, why would the compiler completely disregard my HamRegistries just because it doesn't like the stock?

PS : It compiled perfectly fine before I added the colorchat.
7 Errors.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 02-05-2010 , 16:23   Re: Is The Compiler Racist?
Reply With Quote #2

colorchat isnt included in the web compiler...
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-05-2010 , 16:30   Re: Is The Compiler Racist?
Reply With Quote #3

In addition to what DruGzOG said, you forgot to #include <colorchat>
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 02-05-2010 , 16:34   Re: Is The Compiler Racist?
Reply With Quote #4

Ahh...Im in the credits! Looks good. But will one of us be ranted about having it being done before?

Hey you spelled my name wrong! It's r4nDoMz lol.

BTW:
Yours looks alot better than mine. Also your thing says your a senior member yet your join date is Jan. 2010?

Mind if i use your no-team-hitting idea?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME

Last edited by r4ndomz; 02-05-2010 at 16:41.
r4ndomz is offline
Send a message via Skype™ to r4ndomz
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-05-2010 , 16:41   Re: Is The Compiler Racist?
Reply With Quote #5

I am aware that the compiler doesn't ahve colorchat included, but I figured if I put the stock into the plugin, it wouldn't be an issue. If I'm not mistaken, I've seen many people do it without #include <colorchat>.

@r4ndomz It hasn't been made with the unit conversions + unit velocity settings. I'm sure we'll only get 1 or two of them. Yes, you're welcome to do so. Senior member & Veteran member and all that jazz is based on amount of posts (encourages assisting others and getting work done). 100 = Senior, 500 = Vet

Thanks for the help guys.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 02-05-2010 at 16:44.
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-05-2010 , 16:58   Re: Is The Compiler Racist?
Reply With Quote #6

colorchat is include in this compiler : http://webcomp.ak-team.com/index.php
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-05-2010 , 17:02   Re: Is The Compiler Racist?
Reply With Quote #7

grenadeslap.sma(26) : fatal error 100: cannot read from file: "colorchat"
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 02-05-2010 , 17:13   Re: Is The Compiler Racist?
Reply With Quote #8

Quote:
Originally Posted by wrecked_ View Post
I am aware that the compiler doesn't ahve colorchat included, but I figured if I put the stock into the plugin, it wouldn't be an issue. If I'm not mistaken, I've seen many people do it without #include <colorchat>.

@r4ndomz It hasn't been made with the unit conversions + unit velocity settings. I'm sure we'll only get 1 or two of them. Yes, you're welcome to do so. Senior member & Veteran member and all that jazz is based on amount of posts (encourages assisting others and getting work done). 100 = Senior, 500 = Vet

Thanks for the help guys.
Then you must be crazy active here =)
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-05-2010 , 17:16   Re: Is The Compiler Racist?
Reply With Quote #9

Quote:
Originally Posted by r4ndomz View Post
Then you must be crazy active here =)
Dedication.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 02-05-2010 , 17:17   Re: Is The Compiler Racist?
Reply With Quote #10

Quote:
Originally Posted by wrecked_ View Post
Dedication.
Nice
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
Reply



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 07:18.


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