[HELP]GangSafe
#1

When i do /safestoremats and the ammount it says "unknown command"to the place and i am heres the command
Код:
	if(strcmp(cmd, "/safestoremats", true) == 0)
	{
  if(IsPlayerConnected(playerid))
  {
  	new family = PlayerInfo[playerid][pFMember];
  if(PlayerInfo[playerid][pFMember] == 255)
  {
  SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
  	return 1;
	}
	if(PlayerInfo[playerid][pMember] == 1)
  {
  SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
  	return 1;
	}
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
	format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
	SendClientMessage(playerid, COLOR_GRAD3, string);
	return 1;
	}
	new potdeposit = strval(tmp);
	if(!strlen(tmp))
	{
	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
	format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
	SendClientMessage(playerid, COLOR_GRAD3, string);
	return 1;
	}
	if (potdeposit > PlayerInfo[playerid][pMats] || potdeposit < 1)
	{
	SendClientMessage(playerid, COLOR_GRAD2, "  You dont have that much");
	return 1;
	}
  if(GangSafe(playerid))
  {
	PlayerInfo[playerid][pMats] -= potdeposit;
	FamilyInfo[family][sMats]=potdeposit+FamilyInfo[family][sMats];
	SendClientMessage(playerid, COLOR_WHITE, "|___ SAFE STATMENT ___|");
	format(string, sizeof(string), " Deposit: %d Materials",potdeposit);
	SendClientMessage(playerid, COLOR_GRAD4, string);
	SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
	format(string, sizeof(string), " New Balance: %d Materials", FamilyInfo[family][sMats]);
	SendClientMessage(playerid, COLOR_WHITE, string);
	return 1;
	}
	
	}
  }
	}
Please help thanks
Reply
#2

BUMPED
Reply
#3

What if you add a 'return 1;' on the penultimate line?
(sorry for my english )
Reply
#4

what do u mean?
Reply
#5

Код:
	if(strcmp(cmd, "/safestoremats", true) == 0)
	{
  if(IsPlayerConnected(playerid))
  {
  	new family = PlayerInfo[playerid][pFMember];
  if(PlayerInfo[playerid][pFMember] == 255)
  {
  SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
  	return 1;
	}
	if(PlayerInfo[playerid][pMember] == 1)
  {
  SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
  	return 1;
	}
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
	format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
	SendClientMessage(playerid, COLOR_GRAD3, string);
	return 1;
	}
	new potdeposit = strval(tmp);
	if(!strlen(tmp))
	{
	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
	format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
	SendClientMessage(playerid, COLOR_GRAD3, string);
	return 1;
	}
	if (potdeposit > PlayerInfo[playerid][pMats] || potdeposit < 1)
	{
	SendClientMessage(playerid, COLOR_GRAD2, "  You dont have that much");
	return 1;
	}
  if(GangSafe(playerid))
  {
	PlayerInfo[playerid][pMats] -= potdeposit;
	FamilyInfo[family][sMats]=potdeposit+FamilyInfo[family][sMats];
	SendClientMessage(playerid, COLOR_WHITE, "|___ SAFE STATMENT ___|");
	format(string, sizeof(string), " Deposit: %d Materials",potdeposit);
	SendClientMessage(playerid, COLOR_GRAD4, string);
	SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
	format(string, sizeof(string), " New Balance: %d Materials", FamilyInfo[family][sMats]);
	SendClientMessage(playerid, COLOR_WHITE, string);
	return 1;
	}
	
	}
  }
	return 1;
	}
Reply
#6

im going to test
Reply
#7

Ok now it works but when i do it nothing pops up
Reply
#8

?
Reply
#9

Are you sure thet GangSafe(playerid) return a 1?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)