Raised This Month: $ Target: $400
 0% 

[SOLVED] Smething wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 10-21-2012 , 15:13   [SOLVED] Smething wrong?
Reply With Quote #1

I have this function
Spoiler


Spoiler


This is an example of a call
Spoiler


But for some reason, i do not get any results. No message, no nothing.
Is there something wrong here?

Any help is appreciated...
__________________

Last edited by n0br41ner; 10-22-2012 at 10:02.
n0br41ner is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-21-2012 , 15:25   Re: Smething wrong?
Reply With Quote #2

What is strArray2?

PHP Code:
PrintToImmuneAdminsiPlayerIDiStatestrArray[ ] = ' ' ) { // BAD
PrintToImmuneAdminsiPlayerIDiStatestrArray[ ] ) { // OK 
__________________

Last edited by claudiuhks; 10-21-2012 at 15:25.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 10-21-2012 , 15:40   Re: Smething wrong?
Reply With Quote #3

strArray2 is just a string that i pass to the function.
Why is the first one wrong? I am defaulting the string in case i do not pass anything to it.
__________________
n0br41ner is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-21-2012 , 15:45   Re: Smething wrong?
Reply With Quote #4

PHP Code:
' ' it's a character, not a string.
" " it'
s a string
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 10-21-2012 , 15:46   Re: Smething wrong?
Reply With Quote #5

I know that but would it make a difference between those two?
PHP Code:
' ';
" "
__________________
n0br41ner is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-21-2012 , 16:31   Re: Smething wrong?
Reply With Quote #6

Quote:
Originally Posted by n0br41ner View Post
I know that but would it make a difference between those two?
PHP Code:
' ';
" "
Yes. The former is an integer (character) and the latter is an array (string).
__________________

Last edited by fysiks; 10-21-2012 at 16:31.
fysiks is offline
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 10-21-2012 , 17:32   Re: Smething wrong?
Reply With Quote #7

Alright i get it, but could this be causing any problems?

I default the string to an empty one because i want this function call to work
PHP Code:
PrintToImmuneAdminsiPlayerIDADMIN_2 ); 
__________________

Last edited by n0br41ner; 10-21-2012 at 17:38.
n0br41ner is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-21-2012 , 17:54   Re: Smething wrong?
Reply With Quote #8

Quote:
Originally Posted by n0br41ner View Post
Alright i get it, but could this be causing any problems?

I default the string to an empty one because i want this function call to work
PHP Code:
PrintToImmuneAdminsiPlayerIDADMIN_2 ); 
You are not defaulting the string to an empty string. You are defaulting it to a space, FYI.

Also, write a small test plugin that only performs this function in a chat/console command. Try it there. If it still doesn't work, then you need to find out what is or isn't executing and more than likely you will want to find the value of the variables going in to the function the values of variable inside the function. If you do all these things, you will more than likely find the issue yourself.

If, after you have done all of the above, and you still can't figure it out, post the test plugin here in it's entirety.
__________________
fysiks is offline
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 10-22-2012 , 10:01   Re: Smething wrong?
Reply With Quote #9

I figured what the problem is:
PHP Code:
if( get_pcvar_numg_pcvarPrint ) == ) {
        return 
PLUGIN_HANDLED;
    } 
->
PHP Code:
if( get_pcvar_numg_pcvarPrint ) == ) {
        return 
PLUGIN_HANDLED;
    } 
__________________

Last edited by n0br41ner; 10-22-2012 at 10:02.
n0br41ner 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:37.


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