Raised This Month: $ Target: $400
 0% 

classname


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2011 , 08:07   Re: classname
Reply With Quote #1

Quote:
Originally Posted by usaexelent View Post
So can you guys tell me what's wrong?
See post #6. I gave you the things that I notice were wrong. Fix those and see if it compiles. If it does, test it again to make sure your debug output is what you expect.
__________________
fysiks is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 08-08-2011 , 11:43   Re: classname
Reply With Quote #2

i tooked out classname but still it crashes my game.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new sprite

public plugin_precache()  
{
    
sprite precache_model("sprites/white.spr")
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("laser","trace_line_function")
    
}
public 
trace_line_function(id)
{
    new 
Float:fStart[3]
    new 
Float:fEnd[3]
    new 
Float:fReturn[3// will store the hit origin
    
new iStart[3]
    new 
iEnd[3]

    
get_user_origin(idiStart0)
    
get_user_origin(idiEnd3)

    
IVecFVec(iStartfStart// convert vector from integer to float
    
IVecFVec(iEndfEnd)

    new 
hit trace_line(idfStartfEndfReturn)
    
client_print(idprint_chat,"[debug] hit=%d; start=%d,%d,%d; end=%d,%d,%d; hit origin=%d,%d,%d;"hitiStart[0], iStart[1], iStart[2], iEnd[0], iEnd[1], iEnd[2],fReturn[0],fReturn[1],fReturn[2]) // remove on final version

//new classname[32]
 //pev( id, pev_classname, classname, charmax( classname ) )
 
new ent = -1
 client_print
(idprint_chat,"[debug] hit=%d; start=%d,%d,%d; end=%d,%d,%d;"hitiStart[0], iStart[1], iStart[2], iEnd[0], iEnd[1], iEnd[2]) // remove on final version
 
while(ent find_ent_in_sphereidiEnd200.0 ))
 {
 if(
is_valid_ent(ent))
 
dllfuncDLLFunc_Useent);
 }


    if(
is_user_alive(hit))
    {
         
// your message and kill... still, I recommend you trigger Ham_Killed or Ham_TakeDamage instead of user_kill() because user_kill() acts like suicide.
       
user_kill(hit)
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMPOINTS)
    
write_coord(iStart[0])
    
write_coord(iStart[1])
    
write_coord(iStart[2])
    
write_coord(iEnd[0])
    
write_coord(iEnd[1])
    
write_coord(iEnd[2])
    
write_short(sprite
    
write_byte(1
    
write_byte(1
    
write_byte(10
    
write_byte(5
    
write_byte(0
    
write_byte(0)
    
write_byte(255)
    
write_byte(0)
    
write_byte(70)
    
write_byte(5)
    
message_end()
    }
}



    
// Check if the trace line collided with a player 
usaexelent is offline
Send a message via Skype™ to usaexelent
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2011 , 11:59   Re: classname
Reply With Quote #3

Why are you forcing use on all entities in the radius?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2011 , 12:37   Re: classname
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
Why are you forcing use on all entities in the radius?
because when walls hit use they shoot things
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2011 , 12:38   Re: classname
Reply With Quote #5

Quote:
Originally Posted by Doc-Holiday View Post
because when walls hit use they shoot things
That makes no sense.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2011 , 12:45   Re: classname
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
That makes no sense.
It was a joke ex...

in his sphere he doesnt check if pev_classname = player so it returns all the ents within the sphere ... am i wrong? that includes bomb sites and what not.. atleast when i did a client print wiht the sphere it had issues with it... most of the time it returned the index 0 lol... but then in bomb site it gave me a valid number.

make sense? below is what i mean if my big ass block of text didnt make sense because i cant speak english and its like my only language i know.

PHP Code:
while(ent find_ent_in_sphereidiEnd200.0 )) 

     if(
pev_valid(ent))
     {
          new 
classname[32];
          
pev(entpev_clasnameclassnamecharsmax(classname);
 
          if(
equal(classname"player")
          {
               
dllfunc(DLLFunc_Useent0); 
          }
     }


Last edited by Doc-Holiday; 08-08-2011 at 12:52.
Doc-Holiday is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-09-2011 , 04:29   Re: classname
Reply With Quote #7

I suggest you stop joking when people are asking for info that could help.

For a simple question, how to get classname, this thread has 2 pages... WTF ?

Also, usaexelent, you still have that problem with ignoring what the compiler says...

EDIT: ehm, now 3 pages.
__________________
Hunter-Digital is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-09-2011 , 06:06   Re: classname
Reply With Quote #8

Quote:
Originally Posted by Hunter-Digital View Post
I suggest you stop joking when people are asking for info that could help.

For a simple question, how to get classname, this thread has 2 pages... WTF ?

Also, usaexelent, you still have that problem with ignoring what the compiler says...

EDIT: ehm, now 3 pages.
Extend your post count this is still one page for me.. last post in here i swear...
Doc-Holiday is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 08-09-2011 , 16:40   Re: classname
Reply With Quote #9

Could you people find a another thread for joking?
And BTW Im making this plugin to open door not use players like an entity >And the reason why I'm making it sphere because when you shoot laser some door can be only opened from one side so im making a sphere to catch the other side of door.

Last edited by usaexelent; 08-09-2011 at 16:43.
usaexelent is offline
Send a message via Skype™ to usaexelent
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-09-2011 , 17:06   Re: classname
Reply With Quote #10

Then check classname inside your sphere loop before forcing use on the entity.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
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 03:21.


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