01.02.2018, 11:02
Hello I've making a command for a robbing and After the robbing succesfuly they are spamming the message FORMAT
PHP код:
forward FourDragonRobbery();
public FourDragonRobbery()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) // checking if player connected
{
//ROBBERIES
if(ROBBING_FourDragon[i] > 1) // Checking if robbery time is above 1
{
ROBBING_FourDragon[i] --; // Decreasing time
new time[20]; //adding time variable
format(time,sizeof(time),"%d",ROBBING_FourDragon[i]);
TextDrawSetString(Textdraw494, time);
TextDrawShowForPlayer(i, Textdraw492);
TextDrawShowForPlayer(i, Textdraw493);
TextDrawShowForPlayer(i, Textdraw494);
TextDrawShowForPlayer(i, Textdraw495);
ApplyAnimation(i, "ROB_BANK", "CAT_Safe_Rob", 4.1, 1, 1, 1, 1, 1, 1);
}
if(ROBBING_FourDragon[i] == 1) // IF the timer reached 1
{
new string[150], pName[MAX_PLAYER_NAME];// getting player name
GetPlayerName(i,pName,MAX_PLAYER_NAME);
SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) + 5); //giving player 5 wanted level
SetPlayerColor(i, COLOR_ORANGE);
new mrand =random(200000);
ROBBING_FourDragon[i] = 0; // Complete the timer for next step!
TextDrawHideForPlayer(i, Textdraw494);
format(string,sizeof(string),"[Four Dragon]: %s(%d) has robbed Four Dragon Casino and collect: $%d.",pName,i,mrand);
SendClientMessageToAll(COLOR_RED, string);
ROBBING_FourDragon[i] = 1; // Complete the timer for next step!
SetPlayerRaceCheckpoint(i, 1, 750.7642,382.4462,23.1719,263.0588,0,0, 2);
SetTimer("FourDragonFinal",300000,true);
TimeM = 3;
TimeS = 0;
Time = SetTimer("UpdateTime", 1000, true);
TextDrawShowForPlayer(i, Textdraw494);
}
}
}
return 1;
}