[HELP]/cks accept command not working
#1

When i do /cks accept and the number id it says dis "Sorry, the Killer or Dieer ain't Online." but the players online please tell me whats wrong heres my command
Код:
	if(strcmp(cmd, "/cks", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pAdmin] < 3)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You are not an Admin !");
	      return 1;
	    }
	    new ck;
	    new number = 0;
	    new x_nr[256];
			x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr))
			{
			  for(new i = 0; i < sizeof(CKInfo); i++)
			  {
					number ++;
					if(CKInfo[i][cUsed] != 0)
					{
				    format(string, sizeof(string), "%d| %s wants to Character Kill %s.",number,CKInfo[i][cSendername],CKInfo[i][cGiveplayer]);
				    SendClientMessage(playerid, COLOR_WHITE, string);
			    }
			  }
				return 1;
			}
		  if(strcmp(x_nr,"accept",true) == 0)
			{
			  tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
				  SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cks accept [cknumber]");
					return 1;
				}
				ck = strval(tmp);
				if(ck < 1 || ck > 10) { SendClientMessage(playerid, COLOR_GREY, "  CK Number can't be below 1 or above 10 !"); return 1; }
				ck -= 1;
				new found1 = 255;
				new found2 = 255;
				for(new i = 0; i < MAX_PLAYERS; i++)
				{
				  if(IsPlayerConnected(i))
				  {
				    if(found1 != 255 && found2 != 255)
				    {
							new wstring[MAX_PLAYER_NAME];
							GetPlayerName(i, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "%s", giveplayer);
							strmid(wstring, string, 0, strlen(string), 255);
							if(strcmp(CKInfo[ck][cSendername] ,wstring, true ) == 0 )
							{
							  found1 = i;
							}
							else if(strcmp(CKInfo[ck][cGiveplayer] ,wstring, true ) == 0 )
							{
							  found2 = i;
							}
						}
					}
				}
				if(found1 != 255 && found2 != 255)
  			{
  			  GetPlayerName(found2, giveplayer, sizeof(giveplayer));
  			  format(string, sizeof(string), "* An Admin has accepted your Character Kill, you can now perform your kill on %s.", giveplayer);
  			  SendClientMessage(found1, COLOR_LIGHTBLUE, string);
  			  OnCK[found1] = found2;
  			  GettingCK[found2] = found1;
  			  return 1;
  			}
  			else
  			{
  			  SendClientMessage(playerid, COLOR_YELLOW2, "Sorry, the Killer or Dieer ain't Online.");
  			  return 1;
  			}
			}
			else if(strcmp(x_nr,"delete",true) == 0)
			{
			  tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
				  SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cks delete [cknumber]");
					return 1;
				}
				ck = strval(tmp);
				if(ck < 1 || ck > 10) { SendClientMessage(playerid, COLOR_GREY, "  CK Number can't be below 1 or above 10 !"); return 1; }
				ck -= 1;
				ClearCK(ck);
				ck += 1;
				format(string, sizeof(string), "* You've cleared Character Kill nr: %d", ck);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
				return 1;
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  Invalid CK command name !");
			  return 1;
			}
	  }
	  return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)