01.07.2012, 10:11
When ever I type in the command /previewitem, it just returns to me "Unknown Command" (default SAMP error msg). Now, I use exactly the same way for my accessories store and it works flawlessly. I really can't see what the problem might be.
It prints out "Business found" but still returns "Unknown Command".
pawn Код:
if(strcmp(cmd,"/previewitem",true)==0)
{
print("CMD entered");
if(IsPlayerConnected(playerid))
{
print("Player connected");
for(new i = 0; i < sizeof(Businesses); i++)
{
if (PlayerToPoint(25.0, playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ]))
{
if(GetPlayerVirtualWorld(playerid) == i)
{
if(Businesses[i][BizType] == 11)//Toy store
{
print("Business found");
new string3[4001];
print("string 3 made");
for(new x;x<sizeof(AttachmentObjects);x++)
{
format(string3, sizeof(string3), "%s%s - $%d\n", string3, AttachmentObjects[x][attachname], AttachmentObjects[x][attachprice]);
}
print("string formatted");
ShowPlayerDialog(playerid,79, DIALOG_STYLE_LIST, "{FF0000}Select an item to purchase.", string3, "Buy", "Cancel");
print("Showing the dialog...");
return 1;
}
}
}
else if(i >= sizeof(Businesses) - 1)
{
SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] You're not inside of an accessories store.");
return 1;
}
}
}
return 1;
}