Raised This Month: $51 Target: $400
 12% 

[SLVD] Invalid client index 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 06-14-2015 , 07:33   [SLVD] Invalid client index 0
Reply With Quote #1

Hello! I got this error:
PHP Code:
Native "IsPlayerAlive" reportedInvalid client index 0 
Code:
PHP Code:
public ShopMenuHandler HandlemenuMenuActionactionparam1itemNum ) {

    if ( !
g_MenuOpen param1 ] && IsPlayerAlive param1 ) && g_UseShop ) {

        if ( 
action == MenuAction_Select )
        {
            
// bla bla code
        
}

    }

I can't explain what is the problem..

Last edited by hadesownage; 06-16-2015 at 15:05. Reason: Solved
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 06-14-2015 , 07:39   Re: Invalid client index 0
Reply With Quote #2

All you had to do was read what I said in the first thread:

Quote:
Originally Posted by Mehis View Post
That's because depending on the menu action, param1 and param2 can vary.

PHP Code:
public MenuHandler(Handle:menuMenuAction:actionparam1itemNum)
{
    switch(
action)
    {
        case 
MenuAction_Select :
        {
            
// CODE...
            // param1 will always be the client.
            // param2 will always be the menu item.
        
}
    }

Mehis is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 06-14-2015 , 08:13   Re: Invalid client index 0
Reply With Quote #3

So how can check if the player is alive ?
I'm supposed to check in every case ?
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Miu
Veteran Member
Join Date: Nov 2013
Old 06-14-2015 , 11:40   Re: Invalid client index 0
Reply With Quote #4

dont check unless therye selecting
Miu is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 06-14-2015 , 14:40   Re: Invalid client index 0
Reply With Quote #5

PHP Code:
if(param1 <= || param1 MaxClients){ return; } 
thecount is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 06-16-2015 , 15:06   Re: Invalid client index 0
Reply With Quote #6

Quote:
Originally Posted by Mehis View Post
All you had to do was read what I said in the first thread:
Quote:
Originally Posted by thecount View Post
PHP Code:
if(param1 <= || param1 MaxClients){ return; } 
Thanks! Solved!
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
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 02:45.


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