Server:Unknown command
#1

This command isn't working.It says Server:unknown command
Код:
CMD:robstore(playerid, params[])
{
	if(gTeam[playerid] == LSPD)
	{
	SCM(playerid, COLOR_RED, "[ERROR]: COPS can't perform this action!");
	return 1;
	}
	if(gTeam[playerid] == ROBBERS)
	{
	    if(Robbingfix[playerid] == 0)
	    {
	    	SetPlayerWantedLevelEx(playerid, 1);
			if (StoreHasBeenRobbed > gettime())
			{
			SCM(playerid, COLOR_GREEN, "[ERROR]: This Store has been robbed in the last 5 minutes.");
			return 1;
			}
			if (BankHasBeenRobbed > gettime())
			{
			SCM(playerid, COLOR_GREEN, "[ERROR]: The Bank has been robbed in the last 1 hour.");
			return 1;
			}
			if (RobCooldown > gettime())
			{
			SCM(playerid, COLOR_GREEN, "[ERROR]: You need to wait 20 seconds before robbing.");
			return 1;
			}
			if(RobBank(playerid))
			{
		    new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Bank(Market)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			else if(RobRustyDonuts(playerid))
			{
		    new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Rusty Donuts(Market)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
	 		}
	 		else if(RobPizzaStacks(playerid))
	 		{
		    new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Pizza Stacks(Market)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
	 		}
	 		else if(RobLSPDBinco(playerid))
	 		{
		    new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Binco(Market Road)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
	 		}
	 		else if(RobVeronaBinco(playerid))
	 		{
	 	    new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Binco(Verona Beach)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			else if(Rob247(playerid))
			{
	 		new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob 24/7(Temple)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			else if(RobBurgerShot2(playerid))
			{
	 		new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Burger Shot(Temple)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			else if(RobBurgerShot2(playerid))
			{
	 		new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Burger Shot(Verona)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			else if(RobArmyBinco(playerid))
			{
	 		new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Binco(Rodeo)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			else if(RobSexShop(playerid))
			{
			new string[120];
		    format(string, sizeof(string), "[ROBBERY]: %s is trying to rob Sex Shop(Temple)", PN(playerid));
		    SCMToAll(COLOR_GREEN, string);
		    Robbing[playerid] = 1;
			}
			if(Robbing[playerid] == 1)
			{
			Robbingfix[playerid] = 1;
			SetTimerEx("Robbing2", 45000, false, "i", playerid);
			SendClientMessage(playerid, COLOR_YELLOW, "[INFORMATION]: Robbery has been started, please wait 45 seconds!");
			}
  		}
  	}
	return 1;
}
Reply
#2

Figured it out.. But that problem occured with the line "SetPlayerWantedLevelEx" where ever i use that line my script stops at that place. First i posted a thread that my script stops after onplayerspawn right?. This line was there and i deleted it and script worked and now this command had it again. I deleted it and cmd started working. What's wrong with this line.The stock is this.
PHP код:
stock SetPlayerWantedLevelEx(playeridlevel)
{
   switch(
level)
   {
        case 
0SetPlayerColor(playerid, -1);
        case 
1SetPlayerColor(playeridCOLOR_YELLOW);
        case 
2SetPlayerColor(playeridCOLOR_YELLOW);
        case 
3SetPlayerColor(playeridCOLOR_ORANGE);
        case 
4SetPlayerColor(playeridCOLOR_ORANGE);
        case 
5SetPlayerColor(playeridCOLOR_RED);
        case 
6..1000SetPlayerColor(playeridCOLOR_RED);
   }
   return 
SetPlayerWantedLevel(playeridlevel);

EDIT:Nvm removed this line below and everything worked
PHP код:
#define SetPlayerWantedLevel SetPlayerWantedLevelEx 
Reply
#3

Please change this line on your SetPlayerWantedLevelEx

PHP код:
case 6..1000SetPlayerColor(playeridCOLOR_RED); 
to

PHP код:
default: SetPlayerColor(playeridCOLOR_RED); 
- I know this isn't related to your problem but I am trying to improve your codes -
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)