Confused about command return
#1

Hey everyone!

Just adding some basic commands and debugging when all of a sudden I notice something weird.
I have a custom message in OnPlayerCommandPerformed and that's ok, but why is it being called when I don't want to?

Example: I just took a little portion of code

pawn Код:
CMD:gethere(playerid,params[])
{
    new id;
        // codes...
    if(sscanf(params, "r",id)) return SendClientMessage(playerid,COLOR,"Use: {FFFFFF}/gethere [ID / Name]");
    else
    {
        if(PlayerInfo[id][LoggedOn] == false) return SCM(playerid, COLOR,"That dude is offline!");
        if(id == INVALID_PLAYER_ID)return SCM(playerid,COLOR,"Wrong ID!");
        if(id == playerid)return SCM(playerid,COLOR,"Wrong ID!");
                // codes...
if(id == playerid) WILL BE called, but other checks before won't, resulting in !success OnPlayerCommandPerformed.

Checks are actually in one line but I did this to debug.

This seems strange to me. Maybe I forgot how sscanf works with input arguments but I would really want someone to explain me the reason behind it.

Thanks
Reply


Messages In This Thread
Confused about command return - by Sime30 - 13.06.2016, 22:07
Re: Confused about command return - by lolumadd_ - 14.06.2016, 02:51
Re: Confused about command return - by Dayrion - 14.06.2016, 08:28
Re: Confused about command return - by Sew_Sumi - 14.06.2016, 09:02
Re: Confused about command return - by Sjn - 14.06.2016, 09:16
Re: Confused about command return - by Dayrion - 14.06.2016, 09:16
Re: Confused about command return - by Sime30 - 14.06.2016, 16:38
Re: Confused about command return - by Sjn - 14.06.2016, 16:40
Re: Confused about command return - by Sime30 - 14.06.2016, 16:47
Re: Confused about command return - by zPain - 14.06.2016, 16:51
Re: Confused about command return - by Sjn - 14.06.2016, 16:59
Re: Confused about command return - by Sime30 - 14.06.2016, 17:01

Forum Jump:


Users browsing this thread: 1 Guest(s)