07.01.2014, 11:47
Hi all i hope you can help me with these stupid errors:
when i add the command /createbiz errors are show up, but before i add the command /createbiz its compile perfectly
+REP for who success to help
my enum:
line 1383:
/createbiz command:
when i add the command /createbiz errors are show up, but before i add the command /createbiz its compile perfectly
+REP for who success to help
Код:
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1383) : error 017: undefined symbol "BizInfo" C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1383) : warning 215: expression has no effect C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1383) : error 001: expected token: ";", but found "]" C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1383) : error 029: invalid expression, assumed zero C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1383) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Код:
enum BizInfo
{
bType,
bStatus,
bOwner[32],
Float:bX,
Float:bY,
Float:bZ,
bPickup,
bMoney,
bProducts,
Text3D:bText,
bSold,
bLevel,
bPrice,
bAP,
};
new BizInfo[MAX_BIZ][BizInfo];
Код:
stock RBT(bizid)
{
new string[24];
if(!BizInfo[bizid][bType]) format(string, sizeof(string), "None"); // line 1383
else if(BizInfo[bizid][bType] == 1) format(string, sizeof(string), "24/7 Market");
else if(BizInfo[bizid][bType] == 2) format(string, sizeof(string), "Clothes Shop");
else if(BizInfo[bizid][bType] == 3) format(string, sizeof(string), "Ammunation");
else if(BizInfo[bizid][bType] == 4) format(string, sizeof(string), "Club");
//else if(BizInfo[bizid][bType] == 5) format(string, sizeof(string), "Advertisement Agency");
else if(BizInfo[bizid][bType] == 5) format(string, sizeof(string), "Adv. Agency");
else if(BizInfo[bizid][bType] == 6) format(string, sizeof(string), "Fast Food");
else if(BizInfo[bizid][bType] == 7) format(string, sizeof(string), "Casino");
return string;
}
Код:
CMD:createbiz(playerid, params[])
{
new type, string[128];
if(gPlayerLogged{playerid} == 0) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "i", type))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createbiz [type]");
SendClientMessage(playerid, COLOR_GREY, "TYPES: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club | 5) Advertisement Agency | 6) Fast Food | 7) Casino");
return 1;
}
if(type < 1 || type > 7) return SendClientMessage(playerid, COLOR_GREY, "Businesses are between 1 and 7.");
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(!BizInfo[idx][bType])
{
// g_bizRobber[idx] = -1;
// Getting Business Setup
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
// Making Business
BizInfo[idx][bType] = type;
BizInfo[idx][bStatus] = 0;
format(BizInfo[idx][bOwner], 32, "The State");
BizInfo[idx][bX] = X;
BizInfo[idx][bY] = Y;
BizInfo[idx][bZ] = Z;
BizInfo[idx][bMoney] = 0;
BizInfo[idx][bProducts] = 0;
BizInfo[idx][bSold] = 0;
BizInfo[idx][bLevel] = 1;
BizInfo[idx][bPrice] = 1000000;
BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, X, Y, Z, 0);
format(string, sizeof(string), ""CWE"Business of %s\nBusiness type: %s\nThis business is %s\nPrice: $%d, BizID: %d", BizInfo[idx][bOwner], RBT(idx), RBS(idx), BizInfo[idx][bPrice], idx);
BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, X, Y, Z, 15);
format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created business ID %d.", GetPlayerNameEx(playerid), idx);
ABroadCast(COLOR_DARKRED, string, 1);
Log("logs/business.log", string);
idx = MAX_BIZ;
}
}
return 1;
}


