/BKC Doesnt Remove The Backup Marker -
kepa333 - 27.06.2012
Hi Today Ive solved A problem Wich is That A marker Should Show up When u use /Bk But now I got the Next Problem /BKC = BackupClear Doesnt Remove The Marker From my Map What did i do wrong?
/BKC lines
pawn Код:
if(strcmp(cmd,"/backupclear",true)==0 || strcmp(cmd,"/bkc",true)==0)
{
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "** You are banned From Cop Duty!");
return 1;
}
BackupClear(playerid, 0);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /backupclear",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
My Other BKC lines
pawn Код:
public BackupClear(playerid, calledbytimer)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAFreecop(playerid))
{
if (PlayerInfo[playerid][pRequestingBackup] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pDuty] == 1)
{
if(IsACop(i) || IsAFreecop(i))
{
SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
}
}
}
}
if (calledbytimer != 1)
{
SendClientMessage(playerid, TEAM_BLUE_COLOR, "Your backup request has been cleared.");
}
else
{
SendClientMessage(playerid, TEAM_BLUE_COLOR, "Your backup request has been cleared automatically.");
}
PlayerInfo[playerid][pRequestingBackup] = 0;
}
else
{
if (calledbytimer != 1)
{
SendClientMessage(playerid, COLOR_DARKNICERED, "You don't have an active backup request!");
}
}
}
else
{
if (calledbytimer != 1)
{
SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
}
}
}
return 1;
}
And Just incase u need /bk 2 Here it is Lines:
pawn Код:
if(strcmp(cmd, "/backup", true) == 0 || strcmp(cmd, "/bk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAFreecop(playerid))
{
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "** You are banned From Cop Duty!");
return 1;
}
if(PlayerInfo[playerid][pDuty] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You aren't on duty Duty!");
return 1;
}
if (PlayerInfo[playerid][pRequestingBackup] != 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new Float:L, Float:R, Float:E;
GetPlayerPos(playerid, L, R, E);
format(string, sizeof(string), "(RADIO) All units, %s is requesting immediate assistance, location marked on the map (red)", sendername);
PlayerInfo[playerid][pRequestingBackup] = 1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i) || IsAFreecop(i))
{
SetPlayerCheckpoint(i, L, R, E-10, 1.0);
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
}
SendClientMessage(playerid, COLOR_WHITE, "(INFO) Type /backupclear or /bkc to clear your backup request");
SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "(ERROR) You already have an active backup request");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "(ERROR) Invalid faction");
}
}
return 1;
}
Re: /BKC Doesnt Remove The Backup Marker -
Kindred - 27.06.2012
Could it be because you are not removing the checkpoint when you clear it?
Backup creates a checkpoint, clearing it makes a marker. Whats up with that?
DisablePlayerCheckpoint
Re: /BKC Doesnt Remove The Backup Marker -
kepa333 - 27.06.2012
U read It Wrond Dawg backup Creates A marker on the map if (PlayerInfo[playerid][pRequestingBackup] == 1)
BKC was Made to Delete The marker That was setten on the map
Re: /BKC Doesnt Remove The Backup Marker -
Makaveli93 - 27.06.2012
Should work.
pawn Код:
if(strcmp(cmd,"/backupclear",true)==0 || strcmp(cmd,"/bkc",true)==0)
{
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "** You are banned From Cop Duty!");
return 1;
}
BackupClear(playerid, 0);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /backupclear",d,m,y,h,mi,s,sendername);
CommandLog(string);
DisablePlayerCheckpoint(playerid);
return 1;
}
Or use it here to remove the marker for all cops
pawn Код:
public BackupClear(playerid, calledbytimer)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAFreecop(playerid))
{
if (PlayerInfo[playerid][pRequestingBackup] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pDuty] == 1)
{
if(IsACop(i) || IsAFreecop(i))
{
SetPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 );// According to the SAMP wiki, this will make the marker invisible
}
}
}
}
if (calledbytimer != 1)
{
SendClientMessage(playerid, TEAM_BLUE_COLOR, "Your backup request has been cleared.");
}
else
{
SendClientMessage(playerid, TEAM_BLUE_COLOR, "Your backup request has been cleared automatically.");
}
PlayerInfo[playerid][pRequestingBackup] = 0;
}
else
{
if (calledbytimer != 1)
{
SendClientMessage(playerid, COLOR_DARKNICERED, "You don't have an active backup request!");
}
}
}
else
{
if (calledbytimer != 1)
{
SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
}
}
}
return 1;
}