01.04.2014, 21:38
Hello
I am making a back up command for the LSPD faction.
I decided to put checkpoints but I want to refresh it every 3-4 seconds with the new position of the agent that requested back up.
Is that possible? (Note: It's not an invite system. The factions are with a tag system)
Once again, don't pay attention to the indentation. The forum fucked it up due to the CODE-tag.
This is what I've got:
I am making a back up command for the LSPD faction.
I decided to put checkpoints but I want to refresh it every 3-4 seconds with the new position of the agent that requested back up.
Is that possible? (Note: It's not an invite system. The factions are with a tag system)
Once again, don't pay attention to the indentation. The forum fucked it up due to the CODE-tag.
This is what I've got:
pawn Код:
if(!strcmp(cmdtext, "/bk", true))
{
new sendername[MAX_PLAYER_NAME]; // FOR FORMATS...
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerCop(playerid))
{
if(ICBK[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA,"You need to wait 1 minute before calling backup again!"); // Message if player will want to spam backup..
new string[150];
new pName[MAX_PLAYER_NAME];
ICBK[playerid] = 1; // Is calling backup, so player won't be able to spam it
GetPlayerName(playerid, pName, sizeof(pName));
format(string,sizeof(string),"* %s grabs his dispatcher pulling towards his mouth, pushes the button to talk and starts talking:", Name);
ProxDetector(30.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "{FF0000}.:DISPATCH:.: ALL UNITS! %s is requesting immediate assistance, his location has been located on radar!", pName); // msg
for(new i = 0; i < MAX_PLAYERS; i++) // loop...
{
if(IsPlayerConnected(i))
{
if(IsPlayerCop(i)) // checking if player is cop
{
SendClientMessage(i,0x0FFDD349,string); // same color as in dispatch chat, and it will send msg to cops only
GetPlayerPos(playerid, x, y, z);
SetPlayerCheckpoint(i, x, y, z, 5);
}
}
}
}