(623) : warning 209: function "OnPlayerCommandText" should return a value
#1

Never mind, I fixed it myself. I forgot to add something.
Reply
#2

Line 623, the error says it all. OnPlayerCommandText is supposed to return a value.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/vehicle", true))
    {
        //Your stuff
        return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
    return 0; //<!--- This is what you are missing.
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown to the player.
}
-----------------------------------------------------------------------

Line 637:
GameTextForPlayer has more arguments than just two.

Код:
GameTextForPlayer(playerid, "Text", 5000, 2);
Reply
#3

Quote:
Originally Posted by Codeah
Посмотреть сообщение
Line 623, the error says it all. OnPlayerCommandText is supposed to return a value.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/vehicle", true))
    {
        //Your stuff
        return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
    return 0; //<!--- This is what you are missing.
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown to the player.
}
-----------------------------------------------------------------------

Line 637:
GameTextForPlayer has more arguments than just two.

Код:
GameTextForPlayer(playerid, "Text", 5000, 2);
Thanks but what about the last part of the code? Could you do it for me please?
Reply
#4

Bump
Reply
#5

Quote:
Originally Posted by Triggerz
Посмотреть сообщение
Bump
bumping before 24 hours not allowed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)