Closed UnuAlex closed 6 years ago
I managed to work around by returning 1 after sending the message, like shown bellow.
if(sscanf(params,"d",pnsid))return Text_Send(playerid, $COMMAND_MOVESPRAY), 1;
Hi. That is because the Text_Send function returns -1, so you are sending that -1 to the callback. It's not a plugin bug. Try to return a integer different than -1 in the command and your code will work.
Thanks! I figured that eventually.
Closed!
I added a custom Unknown command message, and even if i type a valid command that message shows up. Note that this bug occurs only when the command returns a error message(like if i dont type a parameter, or if dont fulfill a statement) .
This is the code in OnPlayerCommandPerformed. Right now i use y_text to send messages(because i have multi-language system), but even if i use SendClientMessage(in the callback above) its doing the same thing.
After further testing i found out that this is happening because i use y_text(Text_Send) functions to send messages in my commands, if i use SendClientMessage everything functions normally. Here is a screenshot with the texts: https://imgur.com/4MXs9fC
This the line for /movespray that is checking for params:
if(sscanf(params,"d",pnsid))return Text_Send(playerid, $COMMAND_MOVESPRAY);
And this is the line for the /armour command:
if(sscanf(params,"uf",id,armor))return SCM(playerid,c_ERROR,"Tasteaza:"c_error" /armour[playerid/nume jucator] [armura]","Type:"c_error" /armour[playerid/playerName] [ammount]");