String problem
#1

So I'm making a voicemail, so whenever a player calls somebody the other player can leave a message. Then the other player can do /voicemail to check what somebody left.
But there's one problem: when I leave a message and do /voicemail the message doesn't show.

Code:

Under OnPlayerText

Код:
   	if(IsInVoicemail[playerid] == true)
	{
	    new msg[100];
		new pID = CalledABy[playerid];
	    format(msg,sizeof(msg),"(Cellphone) %s says: %s", GetName(playerid), text);
	    ProxDetector(5.0, playerid, msg, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
	    format(msg,sizeof(msg),"%s", text);
	    Msg1Written[pID] = 1;
		Msg1[pID] = msg;
	}
CMD:

pawn Код:
CMD:voicemail(playerid)
{
    if(PlayerInfo[playerid][pPhone] <= 0) return SendClientMessage(playerid, COLOR_GRAD2, "You don't have a phone!");
    {
        new pID = CalledBy[playerid];
        new string[150];
        format(string,sizeof(string),"You have %d unread messages.", Msg1Written[playerid]);
        SendClientMessage(playerid, COLOR_GREEN, "Welcome to your voicemail!");
        SendClientMessage(playerid, COLOR_YELLOW, string);
       
        if(Msg1Written[playerid] == 1)
        {
            new str[150];
            SendClientMessage(playerid, COLOR_YELLOW, "___MESSAGE 1___");
            format(str,sizeof(str),"Sender (Number): %d",GetPlayerNumber(pID));
            SendClientMessage(playerid, COLOR_YELLOW, str);
            format(str,sizeof(str),Msg1[playerid]);
            SendClientMessage(playerid, COLOR_YELLOW, str);
        }
    }
    return 1;
}
I've tried to replace this:

pawn Код:
format(str,sizeof(str),Msg1[playerid]);
with this:

pawn Код:
format(str,sizeof(str),"%s", Msg1[playerid]);
Didn't work. I've also tried this:

pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, Msg1[playerinfo]);
But that didn't work either. Any help?
Reply


Messages In This Thread
String problem - by Da_Noob - 20.02.2013, 17:04
Re: String problem - by Goldino - 20.02.2013, 17:11
Re: String problem - by Da_Noob - 20.02.2013, 17:13
Re: String problem - by Da_Noob - 20.02.2013, 19:57
Re: String problem - by ikey07 - 20.02.2013, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)