Police Backup Command
#1

I am currently in the process of redesigning the Sheriff's Department's /backup system from checkpoints to a blimp. However where would I start in terms of only showing the Player's location and color when /backup is typed by a member of the faction?

~Nmader
Reply
#2

Код HTML:
if(strcmp("/backup",cmdtext,true,10) == 0)
{
if(ASK HERE IF HE IS A COP DON'T USE PLAYERID USE THE LETTER "" i "")
{
SCM(playerid,-1,"I need Backup come to Checkpoint");
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid,X,Y,Z);
        SetPlayerCheckpoint(i,X,Y,Z,3);
    }
}
}
}
Reply
#3

The thing is, I am trying to avoid checkpoints but rather SetPlayerColor.
Reply
#4

This Should Do It;

PHP код:

// This IS To Requst Backup
if(strcmp(cmd,"/backup",true) == || strcmp(cmd,"/bk",true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsACop(playerid))
            {
                if(
PlayerInfo[playerid][pRequestingBackup] != 1)
                {
                    
GetPlayerNameEx(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "HQ: All units, %s %s %s is requesting backup, they have been marked on your GPS."GetPlayerFactionName(playerid),GetPlayerRank(playerid), sendername);
                    
SendRadioMessage(1TEAM_BLUE_COLORstring);
                    
SendRadioMessage(2TEAM_BLUE_COLORstring);
                    
SendRadioMessage(3TEAM_BLUE_COLORstring);
                    
PlayerInfo[playerid][pRequestingBackup] = 1;
                    for (new 
0MAX_PLAYERSi++)
                    {
                        if(
IsPlayerConnected(i))
                        {
                            if(
IsACop(i))
                            {
                                
SetPlayerMarkerForPlayer(iplayerid0xFF0000FF);
                            }
                        }
                    }
                    
SendClientMessage(playeridTEAM_BLUE_COLOR"Type /bkc to clear your backup request.");
                    
SetTimerEx("BackupClear"180000false"ii"playerid1);
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"You already have an active backup request.");
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"You are not a Cop / FBI / SAST !");
            }
        }
        return 
1;
    } 
And Clear;
PHP код:
    if(strcmp(cmd,"/backupclear",true) == || strcmp(cmd,"/bkc",true) == 0)
    {
        if(
IsACop(playerid))
        {
            
GetPlayerNameEx(playerid,sendername,sizeof(sendername));
            
format(stringsizeof(string), "DISPATCH: %s %s has cancelled their backup request."GetPlayerRank(playerid), sendername);
            
SendRadioMessage(1TEAM_BLUE_COLORstring);
               
SendRadioMessage(2TEAM_BLUE_COLORstring);
              
SendRadioMessage(3TEAM_BLUE_COLORstring);
            
BackupClear(playerid0);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"You are not a law enforcement official.");
        }
        return 
1;
    } 
Reply
#5

Thank you Sig, you have been very helpful.
Reply
#6

Quote:
Originally Posted by nmader
Посмотреть сообщение
Thank you Sig, you have been very helpful.
No Problem Bro
I'm Just Here To Help
Reply
#7

Sry i have writen trash
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)