ERROR 017: undefined symbol "newkeys" ????
#1

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
\\..... there is code


\\.... This is end
}
}
return 1;
}

} // this bracket is closing the if(){} statemnet
} // this bracket is closing the public OnPlayerKeyStateChange



Without this:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
Perfectly work but i need type /enter every time. Some Help?
There is error
.pwn(82016) : error 029: invalid expression, assumed zero
.pwn(82016) : error 017: undefined symbol "newkeys"
.pwn(8201 : warning 219: local variable "string" shadows a variable at a preceding level
.pwn(82019) : error 017: undefined symbol "newkeys"


82016 Line of public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
Reply
#2

You put more "{" than "}"...IDK if its work or not but you can give it a try....

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
if(
newkeys == KEY_SECONDARY_ATTACK)
{
if(
strcmp(cmd"/enter"true) == 0)
{
if(
IsPlayerConnected(playerid))
{
\\..... 
there is code
\\.... This is end
}
}
return 
1;
}

Reply
#3

Edited.
Reply
#4

Do you guys even know what you are doing? Like seriously, that callback doesn't even support inputs...

I'm not sure what you want, you explained what you wanted to do in so many wrong ways. Well:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        // ...
    }
    return 1;
}
Reply
#5

Dude i want to enter in object with F not to type /enter but to make also can type /enter or press F,yes i edideted this and add error to see. Sorry for bad english
Reply
#6

Do not work alredy tried

Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
\\..... there is code
\\.... This is end
}
}
return 1;
}
}

Reply
#7

Try define this :
PHP код:
#define KEY_SECONDARY_ATTACK 
Reply
#8

You're doing it wrong. Where is 'cmd' defined? Exactly, nowhere in that callback. Commands in that form are used in the OnPlayerCommandText callback and not the OnPlayerKeyStateChange callback as Kevln already implied.

WIKI page for the OnPlayerCommandText: https://sampwiki.blast.hk/wiki/OnPlayerCommandText
WIKI page for the OnPlayerKeyStateChange: https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Read about it, then try.
Reply
#9

Yes, the command should be under OnPlayerCommandText
Reply
#10

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
You're doing it wrong. Where is 'cmd' defined? Exactly, nowhere in that callback. Commands in that form are used in the OnPlayerCommandText callback and not the OnPlayerKeyStateChange callback as Kevln already implied.

WIKI page for the OnPlayerCommandText: https://sampwiki.blast.hk/wiki/OnPlayerCommandText
WIKI page for the OnPlayerKeyStateChange: https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Read about it, then try.
Hmm yes it is under OnPlayerCommandText, i need to copied code under
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)?

Thank's for that help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)