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 i = 0; i < g_MaxPlayers; i++) {
if (!is_user_connected(i)) {
continue;
}
doMagic(i, message, GREEN, 5.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 i = 0; i < g_MaxPlayers; i++) {
if (!is_user_connected(i)) {
continue;
}
doMagic(i, "this is a test", GREEN, 5.0);
}
}
What am I doing wrong?