12.05.2018, 10:19
Hello, anyone can help me to fix this? I need your help please, thanks!
ERROR notice when i compile the gamemodes
This is the error script on line 35310
And this the full Create Blackmarket script
ERROR notice when i compile the gamemodes
Код:
C:\Users\pc-01\Desktop\Roleplay\gamemodes\Roleplay.pwn(35310) : error 033: array must be indexed (variable "CP")
PHP код:
BlackMarketInfo[NewBPID][CP] = CreateDynamicCP(BlackMarketInfo[NewBPID][BPX], BlackMarketInfo[NewBPID][BPY],BlackMarketInfo[NewBPID][BPZ], 2, 0, 0, -1, 8.0);
PHP код:
CMD:createbp(playerid, params[])
{
new string[128];
if(PlayerInfo[playerid][pAdmin] >= 99999)
{
new NewBPID = SpawnedBlackMarket+1;
if(NewBPID >= MAX_BLACKMARKET)
{
SendClientMessageEx( playerid, COLOR_WHITE, "Too many MPs are currently spawned!");
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format( string, sizeof( string ), "Black Market/BP_%d.ini", NewBPID);
if(dini_Exists(string))
{
SpawnedBlackMarket++;
format( string, sizeof( string ), "Map (ID: %d) already exist!", NewBPID);
SendClientMessageEx( playerid, COLOR_GREY, string);
SendClientMessageEx( playerid, COLOR_YELLOW, "Please try again by typing /createbp complete" );
}
else
{
new bex[128];
BlackMarketInfo[NewBPID][BPX] = x;
BlackMarketInfo[NewBPID][BPY] = y;
BlackMarketInfo[NewBPID][BPZ] = z;
dini_Create(string);
for(new c; c < MAX_BMITEMS; c++)
{
BMItemsInfo[NewBPID][c][Price] = 0;
BMItemsInfo[NewBPID][c][ExDate] = 999;
BMItemsInfo[NewBPID][c][ExYear] = 9999;
BMItemsInfo[NewBPID][c][GunAmmo] = 0;
BMItemsInfo[NewBPID][c][GunID] = 0;
format(BMItemsInfo[NewBPID][c][Owner], 255, "None");
format(bex, sizeof(bex), "Price%d", c);
dini_Set(string, bex, BMItemsInfo[NewBPID][c][Price]);
format(bex, sizeof(bex), "Date%d", c);
dini_Set(string, bex, BMItemsInfo[NewBPID][c][ExDate]);
format(bex, sizeof(bex), "Year%d", c);
dini_Set(string, bex, BMItemsInfo[NewBPID][c][ExYear]);
format(bex, sizeof(bex), "GunID%d", c);
dini_Set(string, bex, BMItemsInfo[NewBPID][c][GunID]);
format(bex, sizeof(bex), "GunAmmo%d", c);
dini_Set(string, bex, BMItemsInfo[NewBPID][c][GunAmmo]);
format(bex, sizeof(bex), "Owner%d", c);
dini_Set(string, bex, BMItemsInfo[NewBPID][c][Owner]);
}
dini_FloatSet( string, "X", BlackMarketInfo[NewBPID][BPX]);
dini_FloatSet( string, "Y", BlackMarketInfo[NewBPID][BPY]);
dini_FloatSet( string, "Z", BlackMarketInfo[NewBPID][BPZ]);
SpawnedBlackMarket++;
format(string, sizeof(string), "{FFFF00}[Black Market ID %d]\n{FFFFFF}/blackmarket untuk membuka opsi", NewBPID);
blackmarket[NewBPID] = CreateStreamed3DTextLabel(string, COLOR_GREEN, BlackMarketInfo[NewBPID][BPX], BlackMarketInfo[NewBPID][BPY], BlackMarketInfo[NewBPID][BPZ], 10.0, 0);
SendClientMessageEx( playerid, COLOR_LIGHTBLUE, "Black Market berhasil dibuat!" );
BlackMarketInfo[NewBPID][Pickup] = CreateDynamicPickup(1239, 23, BlackMarketInfo[NewBPID][BPX], BlackMarketInfo[NewBPID][BPY], BlackMarketInfo[NewBPID][BPZ], -1, -1, -1, 10.0);
BlackMarketInfo[NewBPID][CP] = CreateDynamicCP(BlackMarketInfo[NewBPID][BPX], BlackMarketInfo[NewBPID][BPY],BlackMarketInfo[NewBPID][BPZ], 2, 0, 0, -1, 8.0);
format(string, sizeof( string ), "ID Black Market baru: %d.", NewBPID);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
}
else
{
SendClientMessageEx( playerid, COLOR_GREY, "You are not authorized to use this command!" );
}
return 1;
}