AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What does "NaN origin" mean? (https://forums.alliedmods.net/showthread.php?t=98286)

Hayer 07-24-2009 06:04

What does "NaN origin" mean?
 
Hi!

Some part of my code returns
"Got a NaN origin on ent_test"

What does this mean? What is the most common error?
Sorry, but I aint got the source here - testing from a external computer.

But as I recall the commands I'm using
* register_touch("ent_test","player","touching" )
* ent_test = create_entity("info_target")
* entity_set_string(ent_TFlag, EV_SZ_classname, "ent_test")
* entity_set_model(ent_test, "models/vip/vip.mdl")
* entity_set_origin( ent_test , testPosition )
* entity_set_int( ent_test, EV_INT_solid, 1 )
* entity_set_int( ent_test, EV_INT_movetype, 6 )

And another problem is that the entity does not appear but I guess thats cause of the "NaN origin"-error?

jim_yang 07-24-2009 06:08

Re: What does "NaN origin" mean?
 
NaN means not a number, must be something wrong with the "testPosition" variable

Hayer 07-24-2009 06:26

Re: What does "NaN origin" mean?
 
First of all; Thanks for a fast replay! :D

Here is how I define the variable testPosition :
new Float:testPosition[3] = { 125 , -1539 , 144 }
then I call the
entity_set_origin( ent_test , testPosition )


Just some off-topic:
Can I do a call like this
entity_set_origin( ent_test , { 125 , -1539 , 144 } )




Edit : It is supposed to spawn somewhere close to the CTSpawn on de_dust.

Arkshine 07-24-2009 06:28

Re: What does "NaN origin" mean?
 
{ 125 , -1539 , 144 } -> { 125.0 , -1539.0 , 144.0 }

Hayer 07-24-2009 06:34

Re: What does "NaN origin" mean?
 
Thanks! Going to test that soon!

This is much closer to C++ syntax then I tough first.

Hayer 07-24-2009 06:58

Re: What does "NaN origin" mean?
 
Okey; thanks! Thats working great!

Now, just a little off-topic

Code:

public touching( pToucher , pTouched )
{
        if( cs_get_user_team( pToucher ) == CS_TEAM_T )
        {
                client_print(1, print_chat, "Your a terrorist!");
        }
}

I guessed that this was wrong - and it was. How would I go about doing this?

TitANious 07-24-2009 07:13

Re: What does "NaN origin" mean?
 
If you print it to "1" Then you print it to "id" "1".
You should do something else. :)

xPaw 07-24-2009 07:15

Re: What does "NaN origin" mean?
 
PHP Code:

public touchingpToucher pTouched )
{
    if( 
is_user_alivepToucher ) )
    {
        if( 
cs_get_user_teampToucher ) == CS_TEAM_T )
        {
            
client_print(pToucherprint_chat"Your a terrorist!");
        }
    }



Hayer 07-24-2009 07:30

Re: What does "NaN origin" mean?
 
I was talking about
Code:

if( cs_get_user_team( pToucher ) == CS_TEAM_T )
It doesn't seem to work :/

Edit:
It only spits out
* [AMXX] Run time error 10: native error (native "cs_get_user_team")
in the serverconsole.

TitANious 07-24-2009 07:46

Re: What does "NaN origin" mean?
 
Have you the module "cstrike"?
And included it in the code?


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

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