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

Error: Argument type mismatch (argument 1) on line ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cader
Senior Member
Join Date: Mar 2007
Old 09-13-2010 , 15:34   Error: Argument type mismatch (argument 1) on line ...
Reply With Quote #1

Hello,

I've created a specialized tsay function from adminchat.sma and use it in my other plugins.

PHP Code:
tsay(msj) {
    
server_cmd("amx_zsay %s"msj)
}


public 
check_bb(id) {
    
tsay("custom msg")
    return 
PLUGIN_HANDLED;

so why can't I use my function like this and get the error?

Quote:
Error: Argument type mismatch (argument 1) on line 81
Cader is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-13-2010 , 15:37   Re: Error: Argument type mismatch (argument 1) on line ...
Reply With Quote #2

You declared the function wrong.

Code:
tsay(msj) {
The msj parameter you used is a cell, or integer variable.

A string is an array of characters, so you have to make the parameter an array.

Code:
tsay(msj[]) {
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Cader
Senior Member
Join Date: Mar 2007
Old 09-13-2010 , 16:31   Re: Error: Argument type mismatch (argument 1) on line ...
Reply With Quote #3

oh sorry it was my fault thanks!!
Cader 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 10:50.


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