AlliedModders

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

usaexelent 08-07-2011 11:22

classname
 
How can i get entitys classname, By classname I mean func_door

bibu 08-07-2011 11:43

Re: classname
 
http://www.amxmodx.org/funcwiki.php?go=func&id=344 ?

usaexelent 08-07-2011 12:04

Re: classname
 
I want the other way around.I want that i could get classname from ent index

abdul-rehman 08-07-2011 13:51

Re: classname
 
Code:
new classname[32] pev( entity_index, pev_classname, classname, charmax( classname ) )

usaexelent 08-07-2011 14:20

Re: classname
 
Why doesn't this work?
new classname[32]
pev( id, pev_classname, classname, charmax( classname ) )
new ent = -1
client_print(id, print_chat,"[debug] hit=%d; start=%d,%d,%d; end=%d,%d,%d; class=%i", hit, iStart[0], iStart[1], iStart[2], iEnd[0], iEnd[1], iEnd[2],classname[32]) // remove on final version
while(ent = find_ent_in_sphere( id, iEnd, 200.0 ))
{
if(is_valid_ent(ent))
dllfunc( DLLFunc_Use, ent, 0 );
}

fysiks 08-07-2011 21:36

Re: classname
 
Quote:

Originally Posted by usaexelent (Post 1527730)
Why doesn't this work?
new classname[32]
pev( id, pev_classname, classname, charmax( classname ) )
new ent = -1
client_print(id, print_chat,"[debug] hit=%d; start=%d,%d,%d; end=%d,%d,%d; class=%i", hit, iStart[0], iStart[1], iStart[2], iEnd[0], iEnd[1], iEnd[2],classname[32]) // remove on final version
while(ent = find_ent_in_sphere( id, iEnd, 200.0 ))
{
if(is_valid_ent(ent))
dllfunc( DLLFunc_Use, ent, 0 );
}

It doesn't compile.

Code:

charsmax()
client_print(0, print_chat, "%s", classname)


Doc-Holiday 08-07-2011 22:06

Re: classname
 
also when putting code in here make it easier for us to read.

use the php and /php tags... put the in []

then it looks like

PHP Code:

client_print(idprint_chat"WAS UP"); 


fysiks 08-07-2011 23:09

Re: classname
 
To clarify, he means to post code like this:

[php]
public plugin_init()
{
register_clcmd("say", "cmdSay")
register_clcmd("say_team", "cmdSay")
}
[/php]

So it looks like this:

PHP Code:

public plugin_init()
{
    
register_clcmd("say""cmdSay")
    
register_clcmd("say_team""cmdSay")


@Doc-Holiday, you can show an example like I did above like this:

[noparse][php]client_print(id, print_chat, "WAS UP");[/php][/noparse]

Doc-Holiday 08-08-2011 00:17

Re: classname
 
Quote:

Originally Posted by fysiks (Post 1527968)
To clarify, he means to post code like this:

[php]
public plugin_init()
{
register_clcmd("say", "cmdSay")
register_clcmd("say_team", "cmdSay")
}
[/php]

So it looks like this:

PHP Code:

public plugin_init()
{
    
register_clcmd("say""cmdSay")
    
register_clcmd("say_team""cmdSay")


@Doc-Holiday, you can show an example like I did above like this:

[noparse][php]client_print(id, print_chat, "WAS UP");[/php][/noparse]

Thanks... lol always wondered how you guys did that.

usaexelent 08-08-2011 02:31

Re: classname
 
So can you guys tell me what's wrong?


All times are GMT -4. The time now is 03:21.

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