Raised This Month: $32 Target: $400
 8% 

ViP Kill Money Error "m_iAccount" not found


Post New Thread Reply   
 
Thread Tools Display Modes
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 12-05-2016 , 10:37   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #11

CamerDisco, I meant that void shouldn't return value.
You should use int for this.
__________________
Grey83 is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 12-05-2016 , 11:07   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #12

Quote:
Originally Posted by CamerDisco View Post
I think it doesn't matter, but yes it see better, he could do it without stacks, but it's more comfortable.
CamerDisco.

Void basically means no return value needed.
Returns used in void would be. "return;" or "return 0;". As return; points to 0 value by default.

When you are using:
return GetEntData(client, g_iAccount); it means you are returning a "integer" with the value of GetEntData, so you'll have to use "int" as the type.

Same as using the IsClientValid stock, it returns a bool of true/false, then the type haves to be "bool".


Sorry about the colors, they are just set for better readability.

Hope this helps.
__________________
xines is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-05-2016 , 11:30   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #13

i dont think he even used the stock we gave him


L 12/05/2016 - 14:209: [SM] Exception reported: Property "m_iAccount" not found (entity 0/worldspawn)
__________________
8guawong is offline
BulgarPL
Member
Join Date: Dec 2015
Old 12-06-2016 , 13:00   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #14

Quote:
Originally Posted by 8guawong View Post
i dont think he even used the stock we gave him


L 12/05/2016 - 14:209: [SM] Exception reported: Property "m_iAccount" not found (entity 0/worldspawn)
I was using it but i stil got errors.


Im testing now Greys version.
BulgarPL is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-06-2016 , 14:41   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #15

Quote:
Originally Posted by Grey83 View Post
better
PHP Code:
stock bool:IsClientValid(client)
{
    return (
client <= MaxClients && IsClientInGame(client));

Code:
stock bool:IsClientValid(client)
{
    return (0 < IsClientInGame(client) <= client <= MaxClients);
}
better?
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is online now
Mitchell
~lick~
Join Date: Mar 2010
Old 12-06-2016 , 15:37   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #16

Quote:
Originally Posted by 1337norway View Post
Code:
stock bool:IsClientValid(client)
{
    return (0 < IsClientInGame(client) <= client <= MaxClients);
}
better?
IIRC No, both are wrong (programmatically). This would be doing (if client was i.e. 5):
0 < true = True,
True <= 5 = True,
True <= MaxClients = True,
The end result is True.

Now if the client passed in was 250:
0 < IsClientInGame(250)
Error: Client Index 250 is invalid.

Last edited by Mitchell; 12-06-2016 at 15:38.
Mitchell is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-07-2016 , 11:01   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #17

Quote:
Originally Posted by Mitchell View Post
IIRC No, both are wrong (programmatically). This would be doing (if client was i.e. 5):
0 < true = True,
True <= 5 = True,
True <= MaxClients = True,
The end result is True.

Now if the client passed in was 250:
0 < IsClientInGame(250)
Error: Client Index 250 is invalid.
Wouldn't it be:
0 < 1 = True
1 < 5 = True
5 < MaxClients = True

&

0 < 250 = True
1 < 250 = True
250 < MaxClients = False
?
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is online now
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 12-07-2016 , 11:30   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #18

1337norway, IsClientInGame() can only take two values: true or false
__________________
Grey83 is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-07-2016 , 11:32   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #19

Quote:
Originally Posted by Grey83 View Post
1337norway, IsClientInGame() can only take two values: true or false
Yes but in memory that would be represented as a non zero value (true) or zero (false), i'd assume the non zero value would be 1 in Sourcemod although i'm not that great at it.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is online now
Mitchell
~lick~
Join Date: Mar 2010
Old 12-07-2016 , 11:40   Re: ViP Kill Money Error "m_iAccount" not found
Reply With Quote #20

Quote:
Originally Posted by 1337norway View Post
Yes but in memory that would be represented as a non zero value (true) or zero (false), i'd assume the non zero value would be 1 in Sourcemod although i'm not that great at it.
Yes, True is 1 and False is 0, however in your statement you said True == 5? And IsClientInGame(205) wouldn't return a value of false but fail to execute since 205 is not a client index.
Edit: This is where I might be wrong on how sourcemod sees
"X < Y < Z"
Does it see it as "X < Y && Y < Z" or does it see it as "(X < Y) < Z"
Which the first statement would be correct, however the second one wouldnt return valid results.
Examples

Last edited by Mitchell; 12-07-2016 at 11:47.
Mitchell is offline
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 18:58.


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