Raised This Month: $ Target: $400
 0% 

Invalid player 4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KamiN
Senior Member
Join Date: Jun 2011
Old 06-19-2012 , 17:02   Invalid player 4
Reply With Quote #1

There is a code

Code:
public fw_cmdstart(player,uc_handle,random_seed)
{
    if(deagle_duel[player])
    {
        cs_set_user_bpammo(player, CSW_DEAGLE, 1)
    }
}
In logs i saw warning

Code:
L 06/19/2012 - 23:24:00: [CSTRIKE] Invalid player 4
L 06/19/2012 - 23:24:00: [AMXX] Displaying debug trace (plugin "jb_days_lr.amxx")
L 06/19/2012 - 23:24:00: [AMXX] Run time error 10: native error (native "cs_set_user_bpammo")
L 06/19/2012 - 23:24:00: [AMXX]    [0] jb_days_lr.sma::fw_cmdstart (line 350)
So i simply should do like that?

Code:
public fw_cmdstart(player,uc_handle,random_seed)
{
    if(deagle_duel[player] && is_user_alive(player))
    {
        cs_set_user_bpammo(player, CSW_DEAGLE, 1)
    }
}
KamiN is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 06-19-2012 , 17:12   Re: Invalid player 4
Reply With Quote #2

Check if user is connected.

Code:
if(is_user_alive(player) && is_user_connected(player) && deagle_duel[player])
__________________
kramesa is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-19-2012 , 17:15   Re: Invalid player 4
Reply With Quote #3

Quote:
Originally Posted by kramesa View Post
Check if user is connected.

Code:
if(is_user_alive(player) && is_user_connected(player) && deagle_duel[player])
is_user_alive already checks that, no need to check it again.
__________________
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
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 06-19-2012 , 17:34   Re: Invalid player 4
Reply With Quote #4

Quote:
Originally Posted by YamiKaitou View Post
is_user_alive already checks that, no need to check it again.
Then, I don't know!
__________________

Last edited by kramesa; 06-19-2012 at 17:34.
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2012 , 19:03   Re: Invalid player 4
Reply With Quote #5

Quote:
Originally Posted by kramesa View Post
Then, I don't know!
We know you don't know.
__________________
fysiks is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-19-2012 , 20:15   Re: Invalid player 4
Reply With Quote #6

Quote:
Originally Posted by kramesa View Post
Then, I don't know!
Just remove the is_user_connected check
__________________
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
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 06-20-2012 , 01:22   Re: Invalid player 4
Reply With Quote #7

PHP Code:
public fw_cmdstart(player,uc_handle,random_seed)
{
     if(
is_user_alive(player) && deagle_duel[player] )
     {
         
cs_set_user_bpammo(playerCSW_DEAGLE1)
     }

Check if is it alive first...
__________________

Last edited by Neeeeeeeeeel.-; 06-20-2012 at 01:22.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-20-2012 , 01:35   Re: Invalid player 4
Reply With Quote #8

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
PHP Code:
public fw_cmdstart(player,uc_handle,random_seed)
{
     if(
is_user_alive(player) && deagle_duel[player] )
     {
         
cs_set_user_bpammo(playerCSW_DEAGLE1)
     }

Check if is it alive first...
No, check deagle_duel first, more efficient and won't change which calls can be passed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 06-20-2012 , 01:44   Re: Invalid player 4
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
No, check deagle_duel first, more efficient and won't change which calls can be passed.
But if 'player' is not a player?
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-20-2012 , 02:01   Re: Invalid player 4
Reply With Quote #10

Not possible from CmdStart.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 06:09.


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