911 bug. - Willing to pay the scripter.
#1

Hey SAMP players, I have a bug in my script. When I call 911, everything goes fine, the PD/EMS receives my message, but it does not close the cellphone..




I would like to have it that it will pocket the cellphone, and that you don't see the (cellphone) word anymore, also that you don't see the cellphone.

I am willing to pay the scripter if he/she knows how to fix this.


Pawn code:
pawn Код:
if(Mobile[playerid] != 9999)
    {
        new idx;
        tmp = strtok(text, idx);
        GetPlayerNameEx(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s says (cellphone): %s", sendername, text);
        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        if(Mobile[playerid] == 914)
        {
         /* if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_ORANGERED, "Operator says: What? Repeat that.");
                return 0;
            }*/

            format(string, sizeof(string), "________911 Call________", GetPlayerNameEx(playerid), text);
            SendEMTMessage(COLOR_LIGHTRED, string);
            format(string, sizeof(string), "Name: %s Phonenumber:", GetPlayerNameEx(playerid), pPnumber);
            SendEMTMessage(COLOR_LIGHTRED, string);
            format(string, sizeof(string), "Incident: %s", text);
                  SendEMTMessage(COLOR_LIGHTRED, string);
            format(string, sizeof(string), "Location: %s", text);
            SendEMTMessage(COLOR_LIGHTRED, string);
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                            CellTime[playerid] = 0;
                            SendClientMessage(playerid, COLOR_GRAD2, "You hung up.");
                            Mobile[playerid] = 225;
        }
      if(Mobile[playerid] == 912)
        {
         /* if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_ORANGERED, "Operator says: What? Repeat that.");
                return 0;
            }*/

            format(string, sizeof(string), "________911 Call________", GetPlayerNameEx(playerid), text);
            SendPoliceMessage(COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "Name: %s", GetPlayerNameEx(playerid));
            SendPoliceMessage(COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "Incident & Location: %s", text);
            SendPoliceMessage(COLOR_LIGHTBLUE, string);
            SendfbiMessage(COLOR_LIGHTBLUE, string);
            Mobile[playerid] = 255;
        }
      if(Mobile[playerid] == 911)
        {
            if (strcmp("Police", text, true, 10) == 0)
            {
              SendClientMessage(playerid, COLOR_GREEN, "Operator says: Ok, you need the police, give a description of the crime and your LOCATION!");
                Mobile[playerid] = 912;
            }
            else if (strcmp("EMS", text, true, 10) == 0)
            {
                SendClientMessage(playerid, COLOR_GREEN, "Operator says: Ok, you need an ambulance, give us your LOCATION.");
                Mobile[playerid] = 914;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREEN, "Operator says: What? I asked do you need the police or a EMS.");
                return 0;
            }
        }
        if(IsPlayerConnected(Mobile[playerid]))
        {
          if(Mobile[Mobile[playerid]] == playerid)
          {
                SendClientMessage(Mobile[playerid], COLOR_YELLOW,string);
            }
        }
        return 0;
    }
Thanks in advance, Michael.
Reply
#2

pawn Код:
Mobile[playerid] = 9999;
Try that.
Reply
#3

Quote:
Originally Posted by Freddo [BINMAN
]
pawn Код:
Mobile[playerid] = 9999;
Try that.
Replacing it with
pawn Код:
if(Mobile[playerid] != 9999)
?
Reply
#4

Quote:
Originally Posted by Michael23
Quote:
Originally Posted by Freddo [BINMAN
]
pawn Код:
Mobile[playerid] = 9999;
Try that.
Replacing it with
pawn Код:
if(Mobile[playerid] != 9999)
?
No, replace it with the code you use to hangup (Mobile[playerid] = 255
Reply
#5

Change:
pawn Код:
SendClientMessage(playerid, COLOR_GRAD2, "You hung up.");
Mobile[playerid] = 225;
To:
pawn Код:
SendClientMessage(playerid, COLOR_GRAD2, "You hung up.");
Mobile[playerid] = 9999;
Hope you get it :P
Reply
#6

@ both, Thanks, it's working, but I still see the cellphone in my hands, which is quite annoying.



Also, I would like to add, when you filled in the location, and you're done with that, that it will show a /me that you putted your cellphone in your pocket, Thanks.
Reply
#7

Quote:
Originally Posted by Michael23
@ both, Thanks, it's working, but I still see the cellphone in my hands, which is quite annoying.



Also, I would like to add, when you filled in the location, and you're done with that, that it will show a /me that you putted your cellphone in your pocket, Thanks.
pawn Код:
SendClientMessage(playerid, COLOR_GRAD2, "You hung up.");
Mobile[playerid] = 9999;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
Reply
#8

pawn Код:
SendClientMessage(playerid, COLOR_GRAD2, "You hung up.");
Mobile[playerid] = 9999;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
new Float:X, Float:Y, Float:Z, message[128], name[MAX_PLAYER_NAME];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, name, sizeof(name));
format(message,sizeof(message), "%s puts his/her phone back in his/her pocket.", name);
for(new i=0; i<MAX_PLAYERS; i++) {
    if(IsPlayerInRangeOfPoint(i, 10, X, Y, Z)) {
        SendClientMessage(i, COLOR_HERE, message);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)