12.12.2012, 12:39
(
Последний раз редактировалось Fernado Samuel; 04.10.2013 в 18:09.
)
Removed
new
index,
cmd[20];
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/telebiz", true) == 0)
{
new
tmp[20],
id;
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerPos(playerid, BizInfo[id][PropX], BizInfo[id][PropY], BizInfo[id][PropZ]);
SendClientMessage(id, 0x00FF00AA, "You have been teleported to your store");
SendClientMessage(playerid, 0x00FF00AA, "Player teleported");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/telebiz <playerid>\"");
}
return 1;
}
return 0;
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;
}