SA-MP Forums Archive
Need help deletenote wont work. - 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)
+--- Thread: Need help deletenote wont work. (/showthread.php?tid=336188)



Need help deletenote wont work. - ToiletDuck - 21.04.2012

/deletenote wont work.
when im going to /deletenote it say Unknown command

Код:
if(strcmp(cmdtext,"/deletenote",true ) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            new x_nr[256];
            x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr))
			{
				SendClientMessage(playerid, COLOR_WHITE, "Command: /deletenote [slot(1-5)]");
				return 1;
			}
			if(strcmp(x_nr,"1",true) == 0)
			{
			    if(PlayerInfo[playerid][pNote1s] == 1)
			    {
			    	strmid(PlayerInfo[playerid][pNote1], "None", 0, strlen("None"), 255);
			    	PlayerInfo[playerid][pNote1s] = 0;
			    	SendClientMessage(playerid, COLOR_WHITE, "Note (slot 1) has been deleted successfuly.");
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, "    You don't have a note at slot 1 ! ");
				}
			}
			else if(strcmp(x_nr,"2",true) == 0)
			{
			    if(PlayerInfo[playerid][pNote2s] == 1)
			    {
			    	strmid(PlayerInfo[playerid][pNote2], "None", 0, strlen("None"), 255);
			    	PlayerInfo[playerid][pNote2s] = 0;
			    	SendClientMessage(playerid, COLOR_WHITE, "Note (slot 2) has been deleted successfuly.");
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, "    You don't have a note at slot 2 ! ");
				}
			}
			else if(strcmp(x_nr,"3",true) == 0)
			{
			    if(PlayerInfo[playerid][pNote3s] == 1)
			    {
			    	strmid(PlayerInfo[playerid][pNote3], "None", 0, strlen("None"), 255);
			    	PlayerInfo[playerid][pNote3s] = 0;
			    	SendClientMessage(playerid, COLOR_WHITE, "Note (slot 3) has been deleted successfuly.");
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, "    You don't have a note at slot 3 ! ");
				}
			}
			else if(strcmp(x_nr,"4",true) == 0)
			{
			    if(PlayerInfo[playerid][pNote4s] == 1)
			    {
			    	strmid(PlayerInfo[playerid][pNote4], "None", 0, strlen("None"), 255);
			    	PlayerInfo[playerid][pNote4s] = 0;
			    	SendClientMessage(playerid, COLOR_WHITE, "Note (slot 4) has been deleted successfuly.");
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, "    You don't have a note at slot 4 ! ");
				}
			}
			else if(strcmp(x_nr,"5",true) == 0)
			{
			    if(PlayerInfo[playerid][pNote5s] == 1)
			    {
			    	strmid(PlayerInfo[playerid][pNote5], "None", 0, strlen("None"), 255);
			    	PlayerInfo[playerid][pNote5s] = 0;
			    	SendClientMessage(playerid, COLOR_WHITE, "Note (slot 5) has been deleted successfuly.");
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, "    You don't have a note at slot 5 ! ");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_WHITE, "    Wrong slot id ! ");
			    return 1;
			}
        }
        return 1;
    }