new Text:WantedTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
WantedTimer[playerid] = TextDrawCreate(505.000000, 411.000000, "Time left: 0");
return 1;
}
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10; //That's from some command that I created.
forward WantedVariables();
public WantedVariables()
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new string[128];
new pname[24];
GetPlayerName(i,pname,sizeof(pname));
if(GetPlayerWeapon(i) != 0)
{
if(WantedTime[i] >= 1)
{
ResetPlayerWeapons(i);
}
}
if(WantedTime[i] > 1)
{
format(string,sizeof(string),"Time left: %d",WantedTime);
TextDrawSetString(Text:WantedTimer[i], string);
WantedTime[i] --;
}
if(WantedTime[i] == 1)
{
format(string,sizeof(string),""COL_YELLOW"[JAIL] "COL_WHITE"%s(%d) has been released from the jail, "COL_REASON"reason: Served his sentence.",pname,i);
SendClientMessageToAll(COLOR_ORANGE,string);
format(string,sizeof(string),"7[JAIL]%s(%d) has been released from the jail, reason: Served his sentence.",pname,i);
TotalWantedTime[i] =0;
WantedTime[i] =0;
TextDrawHideForPlayer(i,WantedTimer[i]);
SetPlayerPos(i,225.8451,112.8976,1003.2188);
SetPlayerFacingAngle(i,1.0816);
SetCameraBehindPlayer(i);
}
}
}
return 1;
}
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10; //That's from some command that I created.
dcmd_arrest(playerid,params[]) //This is the not the full code. There is more commands (if etc. ..) but it is not necessary right now.
{
new string[128];
new ID;
if(GetDistanceBetweenPlayers(playerid,ID) <= 4)
{
IncreasePlayerScore(playerid,2);
TextDrawShowForPlayer(ID,WantedTimer[ID]);
ResetPlayerWeapons(ID);
if(GetPlayerWantedLevel(ID) >= 6)
{
new wanted;
wanted = GetPlayerWantedLevel(ID) * 200;
new wantedtime;
wantedtime = GetPlayerWantedLevel(ID) * 10;
GivePlayerMoney(playerid,wanted);
format(string,sizeof(string),""COL_POLICE"[POLICE] "COL_WHITE"%s(%d) has sent the suspect %s to the jail for: %d.",PlayerName(playerid),playerid,PlayerName(ID),wantedtime);
SendClientMessageToAll(COLOR_ORANGE,string);
format(string,sizeof(string),"7[POLICE] %s(%d) has sent the suspect %s to the jail for: %d.",PlayerName(playerid),playerid,PlayerName(ID),wantedtime);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),""COL_GREEN"[POLICE] "COL_WHITE"You have recieved "COL_YELLOW"$%d "COL_WHITE"for sending the suspect "COL_YELLOW"%s "COL_WHITE"to the jail.",wanted,PlayerName(ID));
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
new Float:x, Float:y, Float:z;
GetPlayerPos(ID, x,y,z);
for(new i=0; i<MAX_PLAYERS; i++)
{
for(new d=0; d<MAX_PLAYER_ATTACHED_OBJECTS; d++)
{
if(IsPlayerAttachedObjectSlotUsed(i, d)) RemovePlayerAttachedObject(i, d);
SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
}
}
new rnd = random(sizeof(JailSpawnPoints));
TotalWantedTime[ID] = GetPlayerWantedLevel(ID) * 10;
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10;
IsTazed[ID] =0;
TazeTime[ID] =0;
IsCuffed[ID] =0;
CuffTime[ID] =0;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
ClearAnimations(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
SetPlayerHealth(ID,999999);
return 1;
}
return 1;
}
return 1;
}
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10;
Код:
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10; |
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10;
so use another variable to store textdraw id.
You cannot store two different things in a variable, lul. |