12.12.2012, 12:54
Without loops and assuming you have your businesses saved by ID.
pawn Код:
CMD:telebiz(playerid, params[])
{
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX: /Telebiz [id]");
new string[100];
format(string,sizeof(string),"/MyServerFiles/MyConfigFiles/MyBusinesses/%d.ini", id); //This should be the path of your businesses, is not necessary but it highly recommended in this situation.
if(fexist(string)) //If the business ID exists
{
SetPlayerPos(playerid, BizInfo[id][PropX], BizInfo[id][PropY], BizInfo[id][PropZ]); //Obviously replace BizInfo with your own enum values etc.
format(string,sizeof(string),"You have teleported to business ID: %d", id);
SendClientMessage(playerid, 0xFFFF00FF, string);
}
else return SendClientMessage(playerid, 0xFF0000FF, "This business doesn't exist, please try again.");
return 1;
}