Respond on the last backup call?
#1

Heey all,

How can i make a respond command to respond on the last backup call?
I have
Код:
dcmd_respond(playerid,params[])
{
	#pragma unused params
    if(gTeam[playerid]!=TEAM_COP)
	{
		SendClientMessage(playerid,COLOR_RED,"This Command is only for Law Enforcement!");
		return 1;
	}
	if(gTeam[playerid]==TEAM_COP)
	{
		if(HasAskedForBackup[playerid]==0)
		{
		    new string[256];
		    HasAskedForBackup[playerid]=1;
			HasBackupTime[playerid]=60;
			SetPlayerColor(playerid,COLOR_PURPLE);
			format(string,sizeof string,"%s[%d] Has Responded On The Last Police Backup Request!",PlayerName(playerid),playerid);
			SendClientMessageToAll(COLOR_PURPLE,string);
			return 1;
		}
		if(HasAskedForBackup[playerid]==1)
		{
		    SendClientMessage(playerid,COLOR_RED,"You Cannot Respond On Your Own Backup!");
			return 1;
		}
	}
	return 1;
}
But i want to make that you can see on who you are responding.
Like:
Код:
format(string,sizeof string,"Admigo Has Responded On Admigo's Police Backup Request!",PlayerName(playerid),playerid);
How can i make this?

Thanks Admigo
Reply
#2

Just create a LastCall variable and store the ID of the person who last called backup
pawn Код:
format(string,sizeof(string),"%s[%d] has responded to the backup call from %s[%d]!",PlayerName(playerid),playerid, PlayerName(LastCall), LastCall);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)