Respond on the last backup call? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Respond on the last backup call? (
/showthread.php?tid=369719)
Respond on the last backup call? -
Admigo - 17.08.2012
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
Re: Respond on the last backup call? -
[ABK]Antonio - 17.08.2012
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);