Good moring. I have problem. I wanted make call with dialog (Like enter your phone number in windows) but i don't know that i should do.
C:\Games\GTA San Andreas\123\gamemodes\11.pwn(3129) : error 033: array must be indexed (variable "phonenumb")
C:\Games\GTA San Andreas\123\gamemodes\11.pwn(3136) : error 033: array must be indexed (variable "phonenumb")
C:\Games\GTA San Andreas\123\gamemodes\11.pwn(3150) : error 033: array must be indexed (variable "phonenumb")
Код:
if(dialogid == CALL_DIALOG_ID)
{
if(response)
{
new phonenumb[99999];
new sendername[MAX_PLAYER_NAME];
new giveplayerid;
format(phonenumb, sizeof(phonenumb), inputtext);
if(IsPlayerConnected(playerid))
{
if(!strlen(phonenumb))
{
SendClientMessage(playerid, COLOR_GRAD2, "*Use /call [Number]");
return 1;
}
if(PlayerInfo[playerid][pBabki] <= 10)
{
SendClientMessage(playerid, COLOR_GRAD2, "*You don't have money");
return 1;
}
if(PlayerInfo[playerid][pMobila] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "*You don't have telephone!");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "*You don't have SIM-CARD buy it in 24/7");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s calling the number", sendername);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(phonenumb == 911)
{
SendClientMessage(playerid, COLOR_WHITE, "*Use /h for stop call");
SendClientMessage(playerid, COLOR_ALLDEPT, "*What you want? Police or Medic");
Mobile[playerid] = 911;
return 1;
}
if(phonenumb == PlayerInfo[playerid][pPnumber])
{
SendClientMessage(playerid, COLOR_GRAD2, "*You have smile upon your face");
return 1;
}
if(Mobile[playerid] != 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "*You ready call?...");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pMobila] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "*Number is busy now");
return 1;
}
if(PhoneOnline[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "*Nobody");
return 1;
}
if (Mobile[giveplayerid] == 255)
{
format(string, sizeof(string), "*Your phone is ding, enter /P. Number: %d", PlayerInfo[playerid][pPnumber]);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
RingTone[giveplayerid] = 10;
format(string, sizeof(string), "*%s start calling", sendername);
SendClientMessage(playerid, COLOR_WHITE, "*Use /h for stop calling");
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CellTime[playerid] = 1;
return 1;
}
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "*Unknown number...");
}
}
return 1;
}
Код:
ShowCallDialog(playerid){
new plname[MAX_PLAYER_NAME];
new sexmessage[MAX_STRING];
GetPlayerName(playerid, plname, MAX_PLAYER_NAME);
format(sexmessage, MAX_STRING, "Eneter your phone number:", plname);
ShowPlayerDialog(playerid, CALL_DIALOG_ID, DIALOG_STYLE_INPUT, "Number:", sexmessage, "Call", "Cancel");
}