20.02.2013, 17:04
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
CMD:
I've tried to replace this:
with this:
Didn't work. I've also tried this:
But that didn't work either. Any help?
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; }
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;
}
pawn Код:
format(str,sizeof(str),Msg1[playerid]);
pawn Код:
format(str,sizeof(str),"%s", Msg1[playerid]);
pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, Msg1[playerinfo]);