Thread: [Solved] argument type mismatch
View Single Post
Author Message
Watermelonnable
Member
Join Date: Feb 2017
Old 12-03-2019 , 22:32   argument type mismatch
Reply With Quote #1

Hello guys. I'm trying to understand where's the problem with my code here.

If I try to call my function "MessageEveryone" and pass it a string as argument, the compiler returns me "argument type mismatch"

This is how I'm trying to test it:

PHP Code:
MessageEveryone("helo"); 
And this is my MessageEveryone function:
PHP Code:
public MessageEveryone(message)
{
    for (new 
0g_MaxPlayersi++) {
        if (!
is_user_connected(i)) {
            continue;
        }
            
        
doMagic(imessageGREEN5.0);
    }

If I remove the "message" parameter and insert the string directly in the "MessageEveryone" function it works perfectly:
PHP Code:
public MessageEveryone()
{
    for (new 
0g_MaxPlayersi++) {
        if (!
is_user_connected(i)) {
            continue;
        }
            
        
doMagic(i"this is a test"GREEN5.0);
    }

What am I doing wrong?

Last edited by Watermelonnable; 12-04-2019 at 18:16. Reason: typos
Watermelonnable is offline