OnPlayerCommandText don't work.
#1

Help me! OnPlayerCommandText don't work on GameModeInit...

see what i did i have main only, OnGameModeInit and OnPlayerCommandText
and that don't do nothing@!!!

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	printf("commandtext");
        return 1;
}
please help me ty.
Reply
#2

what did you expected to happen?
Reply
#3

did you make anything else at all?
Reply
#4

Quote:
Originally Posted by Segura
Посмотреть сообщение
what did you expected to happen?
i try more things like give jetpack or just write message to player but nothing that not return anything...
Quote:
Originally Posted by driftpower
Посмотреть сообщение
did you make anything else at all?
no. that all what write in ther..
Reply
#5

@****** : But if those includes (y_commands and ZCMD for example) use hooking, it's to allow the scripter to use the callback again in his code without expecting any error, isn't it the case ?
Reply
#6

Quote:
Originally Posted by ******
Посмотреть сообщение
Do you have any includes? Several, such as y_commands and ZCMD, replace OnPlayerCommandText.
In my code I use only a_samp and in other include I don't know to use and don't want to.
someone know what the problem.

that all my code

Код:
#include <a_samp>

main()
{
	print("\n----------------------------------");
	print(" ------");
	print("----------------------------------\n");
}
public OnGameModeInit()
{
	SetGameModeText("Map");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	printf("commandtext");
	return 1;
}
Reply
#7

You never call "OnplayerCommandText", so how would you expect something from the callback if it's never called ?

Two ways :

• Type a random command InGame and you'll see the message
• Use CallLocalFunction under the "main" (passing a random command and 0 as playerid)
Reply
#8

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
You never call "OnplayerCommandText", so how would you expect something from the callback if it's never called ?

Two ways :

• Type a random command InGame and you'll see the message
• Use CallLocalFunction under the "main" (passing a random command and 0 as playerid)
see what I posted right now i call him that need to be called alone...
Reply
#9

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
You never call "OnplayerCommandText", so how would you expect something from the callback if it's never called ?

Two ways :

• Type a random command InGame and you'll see the message
• Use CallLocalFunction under the "main" (passing a random command and 0 as playerid)
Use either of the solutions I gave you.
Reply
#10

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Use either of the solutions I gave you.
I check it! that the bug all work but this don't OnPlayerText work,
OnPlayerCommandText don't! that a little wired
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)