13.06.2016, 22:07
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
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
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...
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