Raised This Month: $ Target: $400
 0% 

Error With pfn_touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-08-2012 , 23:40   Error With pfn_touch
Reply With Quote #1

Can anybody tell me what is wrong with this code. I keep getting the errors at the bottom. The plugin is doing what it is suppose to but for some reason I get these errors which from time to time seem to make server CRASH.


PHP Code:
L 08/08/2012 20:35:29Invalid player id 133
L 08
/08/2012 20:35:29: [AMXXDisplaying debug trace (plugin "presents.amxx")
L 08/08/2012 20:35:29: [AMXXRun time error 10native error (native "client_print")
L 08/08/2012 20:35:29: [AMXX]    [0presents.sma::pfn_touch (line 265
Line 265 is: client_print(ptd, print_chat, "[AMXX] YAY I found an Item on the Floor with $%d Dollars", addmoney)


PHP Code:
L 08/08/2012 18:45:59: [CSTRIKEPlayer out of range (104)
L 08/08/2012 18:45:59: [AMXXDisplaying debug trace (plugin "presents.amxx")
L 08/08/2012 18:45:59: [AMXXRun time error 10native error (native "cs_get_user_money")
L 08/08/2012 18:45:59: [AMXX]    [0presents.sma::pfn_touch (line 267
Line 267 is: cs_set_user_money(ptd, totalmoney)
__________________


Last edited by deadman909; 05-14-2013 at 01:33.
deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-09-2012 , 01:07   Re: Error With pfn_touch
Reply With Quote #2

ptd can be other entities than players.
You would have better to use register_touch("xmas_present", "player", "XMasPresent_Touch")

public XMasPresent_Touch(present, player)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-09-2012 at 01:07.
ConnorMcLeod is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-09-2012 , 09:49   Re: Error With pfn_touch
Reply With Quote #3

Hmm thanks. The way you told me fixed that error. But now I get this errors for this other part of the code.
Code:
[AMXX] Displaying debug trace (plugin "presents.amxx")
[AMXX] Run time error 4: index out of bounds 
[AMXX]    [0] presents.sma::CreateEnt (line 223)
[AMXX]    [1] presents.sma::event_RoundStarted (line 141)
This is: [AMXX] [1] presents.sma::event_RoundStarted (line 141)
Line 141 is: CreateEnt(origins[a])
PHP Code:
public event_RoundStarted()
{
    if(!
isLoaded)
        return 
PLUGIN_CONTINUE
        
    
new ab
        
    
for(0totalOriginsa++)
    {
        for(
0PRESENTAMOUNTb++)
        {
            
CreateEnt(origins[a])
        }
    }
    
    return 
PLUGIN_CONTINUE

This is: [AMXX] [0] presents.sma::CreateEnt (line 223)
Line 223 is: CreateEnt(origins[a])
I am pretty sure that it has something to do with the cmd_Spawn because it gives me this error when I compile it: NewPlugin.sma(195) : warning 213: tag mismatch
Line 195 is: set_task(2.5, "CreateEnt", 0, curOrigin, 3)

I tried fixing it by putting: set_task(2.5, "CreateEnt") instead but although it compiles with no errors. It still gives me the errors in the Log.
__________________


Last edited by deadman909; 05-14-2013 at 01:33.
deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
Reply


Thread Tools
Display Modes

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 05:44.


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