Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new index;
new string[128];
new Float:X, Float:Z, Float:Y;
new tmp[64];
tmp = strtok(cmdtext, index);
if (strcmp(cmdtext, "/cbuz", true)==0)
{
for(new i = 1; i < MAX_BUSINESS_NAME; i++) {
if(!strlen(tmp)) {
SendClientMessage(playerid, BIZZ_MESSAGE_COLOR, "USAGE: /cbuz [name]");
return 1;
}
format(bData[i][Name], MAX_BUSINESS_NAME, "%s", tmp);
GetPlayerPos(playerid, X, Y, Z);
new buzname = strval(tmp);
new File:pos=fopen("Businesses.cfg", io_append);
format(string, 256, "%s,%f, %f, %f,%i,%d" ,buzname,X, Y, Z,GetPlayerInterior(i),GetPlayerVirtualWorld(i));
fwrite(pos, string);
fclose(pos);
}
return 1;
}
return 0;
}