error. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error. (
/showthread.php?tid=567606)
error. -
fonia5 - 15.03.2015
Error message.
Код:
error 032: array index out of bounds (variable "ContactData")
Code.
Код:
forward EndCallBecauseWait(playerid);
public EndCallBecauseWait(playerid)
{
strdel(numberab[playerid],0,4);
PlayerTextDrawSetString(playerid,KeyBoard2,"_");
SendClientMessage(playerid, 0xFFFF00AA, "No answered!");
SendClientMessage(ContactData[playerid][caller], 0xFFFF00AA, "Call cancelled!"); // <--- ERROR HERE.
MobilePlayer[ContactData[playerid][caller]][calling] = 0;
MobilePlayer[ContactData[playerid][caller]][caller] = -1;
ContactData[playerid][calling] = 0;
ContactData[playerid][caller] = -1;
return 1;
}
Код:
enum contactData
{
contactID,
contactExists,
contactName[32],
contactNumber,
caller
};
new ContactData[MAX_PLAYERS][MAX_CONTACTS][contactData];
Re : error. -
StreetRP - 15.03.2015
Beacause you have only 2 'i dont know the name in english
'
ContactData
[playerid][caller]
But you must have 3
new ContactData[MAX_PLAYERS][MAX_CONTACTS]
[contactData];
Re: error. -
ATGOggy - 15.03.2015
Try this:
PHP код:
new ContactData[MAX_PLAYERS][contactData];
Why you defined MAX_CONTACTS?
Re: error. -
fonia5 - 15.03.2015
Quote:
Originally Posted by ATGOggy
Try this:
PHP код:
new ContactData[MAX_PLAYERS][contactData];
Why you defined MAX_CONTACTS?
|
that works but its making me delete the 3 as the guy above you said.
Re: error. -
ATGOggy - 15.03.2015
Quote:
Originally Posted by fonia5
that works but its making me delete the 3 as the guy above you said.
|
But I can't understand, why you want three of them?