SA-MP Forums Archive
Dm command isn't working :( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dm command isn't working :( (/showthread.php?tid=277209)



Dm command isn't working :( - PRANK - 16.08.2011

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;
 		}
 	}



Re: Dm command isn't working :( - ElieJabbour - 17.08.2011

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