Command Errors - 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: Command Errors (
/showthread.php?tid=452581)
Command Errors -
San1 - 21.07.2013
pawn Код:
CMD:buybiz(playerid, params[])
{
for(new biz = 0; biz < MAX_BIZ; biz++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez]))
{
if(PlayerInfo[playerid][BizID] == -1)
{
if(BizInfo[biz][Owned] == 0)
{
if(GetPlayerCash(playerid) >= BizInfo[biz][Price])
{
new string[128], string2[128], pname[75];
GivePlayerCash(playerid, -BizInfo[biz][Price]);
BizInfo[biz][Owner] = GetPlayerName(playerid,pname,75);
BizInfo[biz][Owned] = 1;
format(string,sizeof(string),"You've succesfully bought a Business with ID %d!", biz);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
DestroyDynamic3DTextLabel(Text3D:BizLabel[biz]);
format(string2,sizeof(string2),"Owner: %s\n"COL_LBLUE"Biz Name %s\n"COL_BLUE"Type: %s\n"COL_LIME"ID: %d", BizInfo[biz][Owner], BizInfo[biz][Name], BizInfo[biz][Type], biz);
BizLabel[biz] = CreateDynamic3DTextLabel(string2, COLOR_RED, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez], 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 30.0);
SaveBiz(biz);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "That business is already owned!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You already own a Business.");
}
}
}
}
return 1; // Error Here
}
Код:
WW-RP.pwn(1139) : error 010: invalid function or declaration
Re: Command Errors -
JimmyCh - 21.07.2013
pawn Код:
CMD:buybiz(playerid, params[])
{
for(new biz = 0; biz < MAX_BIZ; biz++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez]))
{
if(PlayerInfo[playerid][BizID] == -1)
{
if(BizInfo[biz][Owned] == 0)
{
if(GetPlayerCash(playerid) >= BizInfo[biz][Price])
{
new string[128], string2[128], pname[75];
GivePlayerCash(playerid, -BizInfo[biz][Price]);
BizInfo[biz][Owner] = GetPlayerName(playerid,pname,75);
BizInfo[biz][Owned] = 1;
format(string,sizeof(string),"You've succesfully bought a Business with ID %d!", biz);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
DestroyDynamic3DTextLabel(Text3D:BizLabel[biz]);
format(string2,sizeof(string2),"Owner: %s\n"COL_LBLUE"Biz Name %s\n"COL_BLUE"Type: %s\n"COL_LIME"ID: %d", BizInfo[biz][Owner], BizInfo[biz][Name], BizInfo[biz][Type], biz);
BizLabel[biz] = CreateDynamic3DTextLabel(string2, COLOR_RED, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez], 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 30.0);
SaveBiz(biz);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "That business is already owned!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You already own a Business.");
}
}
}
return 1;
}