Server:Unknown command -
StrikerZ - 08.10.2016
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;
}
Re: Server:Unknown command -
StrikerZ - 08.10.2016
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(playerid, level)
{
switch(level)
{
case 0: SetPlayerColor(playerid, -1);
case 1: SetPlayerColor(playerid, COLOR_YELLOW);
case 2: SetPlayerColor(playerid, COLOR_YELLOW);
case 3: SetPlayerColor(playerid, COLOR_ORANGE);
case 4: SetPlayerColor(playerid, COLOR_ORANGE);
case 5: SetPlayerColor(playerid, COLOR_RED);
case 6..1000: SetPlayerColor(playerid, COLOR_RED);
}
return SetPlayerWantedLevel(playerid, level);
}
EDIT:Nvm removed this line below and everything worked
PHP код:
#define SetPlayerWantedLevel SetPlayerWantedLevelEx
Re: Server:Unknown command -
JaKe Elite - 08.10.2016
Please change this line on your SetPlayerWantedLevelEx
PHP код:
case 6..1000: SetPlayerColor(playerid, COLOR_RED);
to
PHP код:
default: SetPlayerColor(playerid, COLOR_RED);
- I know this isn't related to your problem but I am trying to improve your codes -