911 Call problem / Marker point
#1

Hello everybody.

I post here because I've some problems with my 911 calls.
When someone call the police, the police get the message, but they don't have the checkpoint, here is the code :

pawn Код:
public cops_callCopsUrgence(playerid, raison[])
{
    if(cop_nbrCops <= 0)
        { SendClientMessage(playerid, COLOR_TEL, "[911: Police] No cops are available  !"); return 1; }

    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(proxy_msg, sizeof(proxy_msg), "%s call the police.", playername);
    proxy_sendMsg(playerid, proxy_msg);
    SendClientMessage(playerid,COLOR_TEL,"[911: Police] Don't move !");
    SetTimerEx("resetCallUrgence",120000,false,"d",playerid);
    PlayerInfo[playerid][pUseSpecialColor] = 1;
    print("Lancement Boucle 179");
    for(new i=MIN_PLAYERID; i<MAX_PLAYERS_CURRENT+1; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pMember]== FACT_COPS_LS && OnDuty[i])
        {
            SetPlayerMarkerForPlayer(i, playerid, COLOR_ALERT);
            new stringappel[MAX_STRING_MSG];
            SendClientMessage(i ,COLOR_ALERT,"===========================================================================");
            SendClientMessage(i, COLOR_BLUE, "DISPATCH AUTOMATIQUE DU CENTRE DE TRAITEMENT DE L'ALERTE");
            SendClientMessage(i, COLOR_BLUE, "Nature : Appel d'urgence 'Police secours'.");
            format(stringappel,sizeof(stringappel),"From : %s \n Reason : %s",playername,raison);
            SendClientMessage(i, COLOR_ALERT,stringappel);
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action prioritaire : Envoie d'une PV sur les lieux.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action demandйe : Attente des ordres des supйrieurs.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Que les unitйs а proximitй se rapprochent de la zone, en attente.");
            SendClientMessage(i ,COLOR_ALERT,"===========================================================================");
            SendClientMessage(i, COLOR_SERVER, "[INFO] A checkpoint has been set on your GPS, go !");
        }
    }
    print("Fin Boucle 179");
    return 1;
}





And I have the same problem with the medic code, it says that there is no medic online too, even if i'm on duty.


pawn Код:
public medic_callMedicUrgence(playerid, raison[])
{
    if(Medics <= 0)
        { SendClientMessage(playerid, COLOR_TEL, "[911: LAFMD] No medics are available !"); return 1; }

    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(proxy_msg, sizeof(proxy_msg), "%s calls the medical department.", playername);
    proxy_sendMsg(playerid, proxy_msg);
    SendClientMessage(playerid,COLOR_TEL,"[C.T.A.] An ambulance is coming.");
    SendClientMessage(playerid,COLOR_TEL,"[C.T.A.] They hanged up...");
    SendClientMessage(playerid,COLOR_SERVER,"[INFO] Stay here, an ambulance is coming.");

    medic_needMedic[playerid] = true;
    SetTimerEx("resetCallUrgence",120000,false,"d",playerid);
    PlayerInfo[playerid][pUseSpecialColor] = 1;
    print("Lancement Boucle 178");
    for(new i=MIN_PLAYERID; i<MAX_PLAYERS_CURRENT+1; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pMember]== FACT_LAFMD)
        {
            SetPlayerMarkerForPlayer(i, playerid, COLOR_ALERT);
            new stringappel[MAX_STRING_MSG];
            SendClientMessage(i ,COLOR_ALERT,"====================================================================");
            SendClientMessage(i, COLOR_BLUE, "DISPATCH AUTOMATIQUE DU CENTRE DE TRAITEMENT DE L'ALERTE");
            SendClientMessage(i, COLOR_BLUE, "Nature : Appel d'urgence.");
            format(stringappel,sizeof(stringappel),"FROM : %s \n REASON : %s",playername,raison);
            SendClientMessage(i, COLOR_ALERT,stringappel);
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action prioritaire : Envoyez les secours appropriйs.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action demandйe : Attente des ordres des supйrieurs.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] En cas de problиmes, demandez l'intervention de la police.");
            SendClientMessage(i ,COLOR_ALERT,"====================================================================");
            SendClientMessage(i, COLOR_SERVER, "[INFO] A checkpoint has been set on your GPS, go !");
        }
    }
    print("Fin Boucle 178");
    return 1;
}


Can you please help me with this marker thing please ?
Reply
#2

Quote:
Originally Posted by Kethrios
Посмотреть сообщение
Hello everybody.

I post here because I've some problems with my 911 calls.
When someone call the police, the police get the message, but they don't have the checkpoint, here is the code :

pawn Код:
public cops_callCopsUrgence(playerid, raison[])
{
    if(cop_nbrCops <= 0)
        { SendClientMessage(playerid, COLOR_TEL, "[911: Police] No cops are available  !"); return 1; }

    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(proxy_msg, sizeof(proxy_msg), "%s call the police.", playername);
    proxy_sendMsg(playerid, proxy_msg);
    SendClientMessage(playerid,COLOR_TEL,"[911: Police] Don't move !");
    SetTimerEx("resetCallUrgence",120000,false,"d",playerid);
    PlayerInfo[playerid][pUseSpecialColor] = 1;
    print("Lancement Boucle 179");
    for(new i=MIN_PLAYERID; i<MAX_PLAYERS_CURRENT+1; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pMember]== FACT_COPS_LS && OnDuty[i])
        {
            SetPlayerMarkerForPlayer(i, playerid, COLOR_ALERT);
            new stringappel[MAX_STRING_MSG];
            SendClientMessage(i ,COLOR_ALERT,"===========================================================================");
            SendClientMessage(i, COLOR_BLUE, "DISPATCH AUTOMATIQUE DU CENTRE DE TRAITEMENT DE L'ALERTE");
            SendClientMessage(i, COLOR_BLUE, "Nature : Appel d'urgence 'Police secours'.");
            format(stringappel,sizeof(stringappel),"From : %s \n Reason : %s",playername,raison);
            SendClientMessage(i, COLOR_ALERT,stringappel);
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action prioritaire : Envoie d'une PV sur les lieux.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action demandйe : Attente des ordres des supйrieurs.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Que les unitйs а proximitй se rapprochent de la zone, en attente.");
            SendClientMessage(i ,COLOR_ALERT,"===========================================================================");
            SendClientMessage(i, COLOR_SERVER, "[INFO] A checkpoint has been set on your GPS, go !");
        }
    }
    print("Fin Boucle 179");
    return 1;
}





And I have the same problem with the medic code, it says that there is no medic online too, even if i'm on duty.


pawn Код:
public medic_callMedicUrgence(playerid, raison[])
{
    if(Medics <= 0)
        { SendClientMessage(playerid, COLOR_TEL, "[911: LAFMD] No medics are available !"); return 1; }

    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(proxy_msg, sizeof(proxy_msg), "%s calls the medical department.", playername);
    proxy_sendMsg(playerid, proxy_msg);
    SendClientMessage(playerid,COLOR_TEL,"[C.T.A.] An ambulance is coming.");
    SendClientMessage(playerid,COLOR_TEL,"[C.T.A.] They hanged up...");
    SendClientMessage(playerid,COLOR_SERVER,"[INFO] Stay here, an ambulance is coming.");

    medic_needMedic[playerid] = true;
    SetTimerEx("resetCallUrgence",120000,false,"d",playerid);
    PlayerInfo[playerid][pUseSpecialColor] = 1;
    print("Lancement Boucle 178");
    for(new i=MIN_PLAYERID; i<MAX_PLAYERS_CURRENT+1; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pMember]== FACT_LAFMD)
        {
            SetPlayerMarkerForPlayer(i, playerid, COLOR_ALERT);
            new stringappel[MAX_STRING_MSG];
            SendClientMessage(i ,COLOR_ALERT,"====================================================================");
            SendClientMessage(i, COLOR_BLUE, "DISPATCH AUTOMATIQUE DU CENTRE DE TRAITEMENT DE L'ALERTE");
            SendClientMessage(i, COLOR_BLUE, "Nature : Appel d'urgence.");
            format(stringappel,sizeof(stringappel),"FROM : %s \n REASON : %s",playername,raison);
            SendClientMessage(i, COLOR_ALERT,stringappel);
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_BLUE, "");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action prioritaire : Envoyez les secours appropriйs.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] Action demandйe : Attente des ordres des supйrieurs.");
            SendClientMessage(i, COLOR_ALERT, "[C.T.A.] En cas de problиmes, demandez l'intervention de la police.");
            SendClientMessage(i ,COLOR_ALERT,"====================================================================");
            SendClientMessage(i, COLOR_SERVER, "[INFO] A checkpoint has been set on your GPS, go !");
        }
    }
    print("Fin Boucle 178");
    return 1;
}


Can you please help me with this marker thing please ?
PHP код:
public cops_callCopsUrgence(playeridraison[])
{
    if(
cop_nbrCops <= 0)return SendClientMessage(playeridCOLOR_TEL"[911: Police] No cops are available  !");
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernamesizeof(playername));
    
format(proxy_msgsizeof(proxy_msg), "%s call the police."playername);
    
proxy_sendMsg(playeridproxy_msg);
    
SendClientMessage(playerid,COLOR_TEL,"[911: Police] Don't move !");
    
SetTimerEx("resetCallUrgence",120000,false,"d",playerid);
    
PlayerInfo[playerid][pUseSpecialColor] = 1;
    print(
"Lancement Boucle 179");
    for(new 
ii<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][pMember]== FACT_COPS_LS && OnDuty[i])
        {
            
SetPlayerMarkerForPlayer(iplayeridCOLOR_ALERT);
            new 
stringappel[MAX_STRING_MSG];
            
SendClientMessage(,COLOR_ALERT,"===========================================================================");
            
SendClientMessage(iCOLOR_BLUE"DISPATCH AUTOMATIQUE DU CENTRE DE TRAITEMENT DE L'ALERTE");
            
SendClientMessage(iCOLOR_BLUE"Nature : Appel d'urgence 'Police secours'.");
            
format(stringappel,sizeof(stringappel),"From : %s \n Reason : %s",playername,raison);
            
SendClientMessage(iCOLOR_ALERT,stringappel);
            
SendClientMessage(iCOLOR_BLUE"");
            
SendClientMessage(iCOLOR_BLUE"");
            
SendClientMessage(iCOLOR_ALERT"[C.T.A.] Action prioritaire : Envoie d'une PV sur les lieux.");
            
SendClientMessage(iCOLOR_ALERT"[C.T.A.] Action demandйe : Attente des ordres des supйrieurs.");
            
SendClientMessage(iCOLOR_ALERT"[C.T.A.] Que les unitйs а proximitй se rapprochent de la zone, en attente.");
            
SendClientMessage(,COLOR_ALERT,"===========================================================================");
            
SendClientMessage(iCOLOR_SERVER"[INFO] A checkpoint has been set on your GPS, go !");
        }
    }
    print(
"Fin Boucle 179");
    return 
1;

your problem is
PHP код:
for(new i=MIN_PLAYERIDi<MAX_PLAYERS_CURRENT+1i++) 
you don't loop by everyone
and i don't know which number is behind this two values
Reply
#3

This is the 1st user ID possible
pawn Код:
#define MIN_PLAYERID 0
This is for max user connected
pawn Код:
new MAX_PLAYERS_CURRENT = 0;
What does mean that I don't look by everyone ?
Thanks for answering.
Reply
#4

Quote:
Originally Posted by Kethrios
Посмотреть сообщение
This is the 1st user ID possible
pawn Код:
#define MIN_PLAYERID 0
This is for max user connected
pawn Код:
new MAX_PLAYERS_CURRENT = 0;
What does mean that I don't look by everyone ?
Thanks for answering.
you don`t need that i hope you know the function of a loop.

PHP код:
for(new iMAX_PLAYERSi++){

the code in the for loop is called 500 times
0 1 2 3 .. until 499

the new set the value for i only 0
you can define i also out of the loop
[php]new i;
PHP код:
for(; MAX_PLAYERSi++){ 
if you want to reduce your resource consumption you have to define MAX_PLAYERS new
PHP код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 100 
100 is an example value you have to write there the slot number of your server.

ok now we look at your for-loop

PHP код:
#define MIN_PLAYERID 0
new MAX_PLAYERS_CURRENT 0
PHP код:
for(; 0i++){ 
that means that the for loop while going on until the values are the same.
Reply
#5

But modifying to :
pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)

it worked.




The thing is... When someone calls, he get a marker, and police have the GPS.
The only problem is that when there are close to it, it disappear, how can I fix this ?

Because they are close and far away from it at the same time, it's hard after to know where the call was.

Thank you !
Reply
#6

Still have the marker problem when the police is close to it, I tried to search on the forum, but without any great result.
Is there someone who can try to help me for this please ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)