SA-MP Forums Archive
error 004: function "S@@_OnPlayerCommandText" is not implemented - 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: error 004: function "S@@_OnPlayerCommandText" is not implemented (/showthread.php?tid=628951)



error 004: function "S@@_OnPlayerCommandText" is not implemented - SH0x - 17.02.2017

i get this error when I want ro compile gamemode :

(19972) : error 004: function "S@@_OnPlayerCommandText" is not implemented
(19979) : error 004: function "S@@_OnPlayerCommandText" is not implemented


this is line 19972 and 19979 :
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( newkeys & KEY_NO )
{
19972: OnPlayerCommandText(playerid, "/lock");
return 0;
}
if(newkeys & KEY_SUBMISSION)
{
if(IsPlayerInAnyVehicle(playerid))
{
19979: OnPlayerCommandText(playerid, "/engine");
return 1;
}
}


Re: error 004: function "S@@_OnPlayerCommandText" is not implemented - Vince - 17.02.2017

You shouldn't call a callback like that. Rather you should move the contents of the commands to separate functions and have these functions be called by the command and by the keypress.


Re: error 004: function "S@@_OnPlayerCommandText" is not implemented - SH0x - 17.02.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
You shouldn't call a callback like that. Rather you should move the contents of the commands to separate functions and have these functions be called by the command and by the keypress.
sorry can u give an example for that ?


Re: error 004: function "S@@_OnPlayerCommandText" is not implemented - tekass - 05.06.2017

Hi, here is an example of using the OnPlayerCommandText:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext,"/lock",true)) 
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_MSG,"You have to be inside a 
vehicle.");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
        }
        return 1;
    }
    return 0;
}
And for further information you always have the site dedicated to the learning of PAWN:https://sampwiki.blast.hk/wiki/OnPlayerCommandText