CellPhone.
#1

Hello Guys,

I have this code:
pawn Код:
if(Mobile[playerid] != 255)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof string,"%s (cellphone): %s",pname,text);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    }
My problem is when I talk into the cellphone,the man on the other side can't see what I "talked" only me..
There is a problem in this line I think:
pawn Код:
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
Reply
#2

What is that code?Your /speakerphone code or what?

EDIT:Ow I see what you mean now.Try this:
pawn Код:
if(Mobile[playerid] != 255)
    {
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof string,"%s (cellphone): %s",pname,text);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        format(string, sizeof(string),"%s (cellphone): %s",pname,text);
        SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    }
Reply
#3

Quote:
Originally Posted by Necip
Посмотреть сообщение
What is that code?Your /speakerphone code or what?
Its after I am calling him and talk in the chat normaly.

For instant:

Ben_Ten (cellphone): Sup?

So the problem is the other man can't see it ..
Reply
#4

I edited it, sorry.
Reply
#5

It doesn't worked,the other side don't get the message.
Here a picture:



http://imageshack.us/photo/my-images/515/xty.png/
Reply
#6

Can you show us the part with:
giveplayerid = ...
Reply
#7

Quote:
Originally Posted by CAR
Посмотреть сообщение
Can you show us the part with:
giveplayerid = ...
Its like this:

pawn Код:
new giveplayerid;
Reply
#8

Can we see the /call command or whatever makes a player call someone else in your gamemode?
giveplayerid is most likely assigned wrongly or not assigned at all.
Reply
#9

Quote:
Originally Posted by GiamPy.
Посмотреть сообщение
Can we see the /call command or whatever makes a player call someone else in your gamemode?
giveplayerid is most likely assigned wrongly or not assigned at all.
pawn Код:
if(strcmp(cmd, "/call", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /call [phonenumber]");
                return 1;
            }
            if(PlayerInfo[playerid][pNumber] == 0)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  You don't have a cell phone!");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes out a cellphone.", sendername);
            SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            new phonenumb = strval(tmp);
            if(phonenumb == 555)
            {
                SendClientMessage(playerid, COLOR_GREY, "   They Picked up the call.");
                SendClientMessage(playerid, 0xBBE1F2AA, "Man voice says (cellphone): Hello, what is your location?");
                Mobile[playerid] = 555;
                MechanicCall = 1;
                return 1;
            }
            if(phonenumb == PlayerInfo[playerid][pNumber])
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  You just get a busy tone...");
                return 1;
            }
            if(Mobile[playerid] != 255)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  You are already on a call...");
                return 1;
            }
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pNumber] == phonenumb && phonenumb != 0)
                    {
                        giveplayerid = i;
                        Mobile[playerid] = giveplayerid; //caller connecting
                        if(IsPlayerConnected(giveplayerid))
                        {
                            if(giveplayerid != INVALID_PLAYER_ID)
                            {
                                if(PhoneOnline[giveplayerid] > 0)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   That players Phone is Offline!");
                                    return 1;
                                }
                                if (Mobile[giveplayerid] == 255)
                                {
                                    format(string, sizeof(string), "Your Mobile is Ringing Type (/pickup) CallerID: %s", sendername);
                                    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                                    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
                                    RingTone[giveplayerid] = 10;
                                    format(string, sizeof(string), "* %s's phone begins to ring.", sendername);
                                    SendClientMessage(playerid, COLOR_WHITE, "HINT: You now use T to talk on your cellphone, type /hangup to hang up");
                                    ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    CellTime[playerid] = 1;
                                    return 1;
                                }
                            }
                        }
                    }
                }
            }
            SendClientMessage(playerid, COLOR_GRAD2, "  You just get a Busy tone...");
        }
        return 1;
    }
Thanks for replay pal
Reply
#10

UP .. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)