Dm command isn't working :(
#1

Hello!

I've tried to made a command which send a message if u aren't in a dm and send an other message if u are in a dm. Its compiled but doesn't work... It sends the first message every time. What is the problem, what should i do?

Here is the code:
Код:
	if(strcmp("/dm", cmdtext, true, 10) == 0)
	{
		indm[playerid] = 1; return 1;
   	}
	if(strcmp("/exitdm", cmdtext, true, 10) == 0)
	{
		indm[playerid] = 0; return 1;
   	}
	if(strcmp("/test", cmdtext, true, 10) == 0)
	{
  		if(indm[playerid] == 1)
 		{
 		SendClientMessage(playerid, red, "u're in dm");
 		} else {
 		SendClientMessage(playerid, yellow, "u aren't in dm");
 		return 1;
 		}
 	}
Reply
#2

pawn Код:
if(strcmp("/dm", cmdtext, true, 10) == 0)
    {
        indm[playerid] = 1;
    return 1;
    }
    if(strcmp("/exitdm", cmdtext, true, 10) == 0)
    {
        indm[playerid] = 0;
    return 1;
    }
    if(strcmp("/test", cmdtext, true, 10) == 0)
    {
        if(indm[playerid] == 1)
        {
        SendClientMessage(playerid, red, "u're in dm");
        } else {
        SendClientMessage(playerid, yellow, "u aren't in dm");
        return 1;
        }
    }
Try this, and make sure you define indm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)