SA-MP Forums Archive
(623) : warning 209: function "OnPlayerCommandText" should return a value - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: (623) : warning 209: function "OnPlayerCommandText" should return a value (/showthread.php?tid=626893)



Nevermind - Triggerz - 21.01.2017

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


Re: (623) : warning 209: function "OnPlayerCommandText" should return a value - Codeah - 21.01.2017

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);



Re: (623) : warning 209: function "OnPlayerCommandText" should return a value - Triggerz - 21.01.2017

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?


Re: (623) : warning 209: function "OnPlayerCommandText" should return a value - Triggerz - 21.01.2017

Bump


Re: (623) : warning 209: function "OnPlayerCommandText" should return a value - Yaa - 21.01.2017

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