SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/02/2017, 02:50 PM   #1
SH0x
Little Clucker
 
Join Date: Jan 2017
Posts: 41
Reputation: 0
Default error 004: function "S@@_OnPlayerCommandText" is not implemented

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;
}
}
SH0x is offline   Reply With Quote
Old 17/02/2017, 03:20 PM   #2
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,068
Reputation: 2655
Default Re: error 004: function "S@@_OnPlayerCommandText" is not implemented

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.
__________________
Vince is offline   Reply With Quote
Old 17/02/2017, 03:34 PM   #3
SH0x
Little Clucker
 
Join Date: Jan 2017
Posts: 41
Reputation: 0
Default Re: error 004: function "S@@_OnPlayerCommandText" is not implemented

Quote:
Originally Posted by Vince View Post
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 ?
SH0x is offline   Reply With Quote
Old 05/06/2017, 02:03 PM   #4
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Post Re: error 004: function "S@@_OnPlayerCommandText" is not implemented

Hi, here is an example of using the OnPlayerCommandText:

Code:
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:http://wiki.sa-mp.com/wiki/OnPlayerCommandText
tekass is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
: error 004: function "splits" is not implemented [SOLVED] ervinmasic Scripting Help 0 14/12/2015 08:51 PM
"S@@_OnPlayerCommandText" is not implemented Brandon_More Scripting Help 6 08/01/2014 03:19 PM
Error "function "PublicLog" is not implemented" ZdupX Scripting Help 3 29/08/2013 09:36 AM
Have problem pls help me out... (error 004: function "SetPlayerTeamFromClass" is not implemented) Scrillex Scripting Help 2 24/01/2012 01:43 PM
error 004: function "LoadDust" is not implemented admantis Help Archive 1 21/12/2010 05:57 AM


All times are GMT. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.