Alright, im working on some random commands, and for some damn reason this command won't run the timers set in it.
Here's the code, I get 0 response from the timers, hopefully you guys show me the issue.
pawn Код:
CMD:robshop(playerid, params[])
{
new string[128];
if(Shop1[playerid] == 1)
{
if(Shop1robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on The Strip.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop1[playerid] = 1;
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("Robshop1", 1000, false, "d", playerid);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop2[playerid] == 1)
{
if(Shop2robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop2[playerid] = 1;
SetTimerEx("Robshop2", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop3[playerid] == 1)
{
if(Shop3robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop3[playerid] = 1;
SetTimerEx("Robshop3", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop4[playerid] == 1)
{
if(Shop4robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop4[playerid] = 1;
SetTimerEx("Robshop4", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop5[playerid] == 1)
{
if(Shop5robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop5[playerid] = 1;
SetTimerEx("Robshop5", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop6[playerid] == 1)
{
if(Shop6robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop6[playerid] = 1;
SetTimerEx("Robshop6", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop7[playerid] == 1)
{
if(Shop7robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop7[playerid] = 1;
SetTimerEx("Robshop7", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
else if(Shop8[playerid] == 1)
{
if(Shop8robbed == 0)
{
format(string, sizeof(string), "%s has begun robbing a 24/7 shop on insertlocation.", pName(playerid));
SendClientMessageToAll(COLOR_GREEN, string);
RobbingShop8[playerid] = 1;
SetTimerEx("Robshop8", 1000, false, "d", playerid);
GameTextForPlayer(playerid, "ROBBING WILL FINISH IN 30 SECONDS", 4999, 4);
SetTimerEx("CountDown", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This shop has been robbed recently.");
}
}
return 1;
}
The Shop1-8 are set as you enter the place, which works because the robbing countdown works, just not the robshop1-8. Here's an example of robshop1
I get absolutely no response from the RobShop1 timer, please help, thank you in advance!
You're calling a public with the name Robshop1 which doesn't probably exist actually it's RobShop1, so your SetTimer call should be: