error 004: function "S@@_OnPlayerCommandText" is not implemented
#1

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;
}
}
Reply
#2

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.
Reply
#3

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 ?
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)