26.11.2014, 10:37
Please help me to work these FS
--------------------
COMMAND:createbiz(playerid, params[])
{
new busid,cost,name[128];
new Float,Float:y;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"I(500000)S(For Sale)[128]",cost,name))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /createbiz [cost] [name]");
for(new i=0; i<MAX_BUSS; i++)
{
format(file,sizeof(file),"Business/%i.ini",i);
if(!dini_Exists(file))
{
busid = i;
break;
}
}
format(file,sizeof(file),"Business/%i.ini",busid);
BusinessInfo[busid][bName] = name;
BusinessInfo[busid][Cost] = cost;
GetPlayerPos(playerid, X, Y, Z);
GetPosInFrontOfPlayer(playerid, x, y, -2.5);
dini_Create(file);
dini_Set(file, "Name", name);
dini_Set(file, "Owner","No Owner");
dini_IntSet(file, "Cost",cost);
dini_FloatSet(file, "BusX", X);
dini_FloatSet(file, "BusY", Y);
dini_FloatSet(file, "BusZ", Z);
dini_FloatSet(file, "SpawnOutX", x);
dini_FloatSet(file, "SpawnOutY", y);
dini_FloatSet(file, "SpawnOutZ", Z);
dini_IntSet(file, "World",GetPlayerVirtualWorld(playerid));
dini_IntSet(file, "Interior",GetPlayerInterior(playerid));
dini_IntSet(file, "OwnedBus",0);
dini_IntSet(file, "HasOwner",0);
BusinessInfo[busid][CP] = CreateDynamicCP(X,Y,Z,1.0,GetPlayerVirtualWorld(pl ayerid),GetPlayerInterior(playerid),-1,50.0);
format(Label, sizeof(Label), "{ccccff}%s\n{999999}No Owner\n{00BC00}Cost: {999999}$%i\nID: %i", name,cost,busid);
BusinessInfo[busid][bLabel] = Create3DTextLabel(Label,White,X,Y,Z,100.0,GetPlaye rVirtualWorld(playerid),1);
format(String,sizeof(String),"BusinessCreated. Name: %s | Cost: $%i | Owner: No Owner | ID: %i",name,cost,busid);
SendClientMessage(playerid,Green,String);
return 1;
}
------
--------------------
COMMAND:createbiz(playerid, params[])
{
new busid,cost,name[128];
new Float,Float:y;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"I(500000)S(For Sale)[128]",cost,name))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /createbiz [cost] [name]");
for(new i=0; i<MAX_BUSS; i++)
{
format(file,sizeof(file),"Business/%i.ini",i);
if(!dini_Exists(file))
{
busid = i;
break;
}
}
format(file,sizeof(file),"Business/%i.ini",busid);
BusinessInfo[busid][bName] = name;
BusinessInfo[busid][Cost] = cost;
GetPlayerPos(playerid, X, Y, Z);
GetPosInFrontOfPlayer(playerid, x, y, -2.5);
dini_Create(file);
dini_Set(file, "Name", name);
dini_Set(file, "Owner","No Owner");
dini_IntSet(file, "Cost",cost);
dini_FloatSet(file, "BusX", X);
dini_FloatSet(file, "BusY", Y);
dini_FloatSet(file, "BusZ", Z);
dini_FloatSet(file, "SpawnOutX", x);
dini_FloatSet(file, "SpawnOutY", y);
dini_FloatSet(file, "SpawnOutZ", Z);
dini_IntSet(file, "World",GetPlayerVirtualWorld(playerid));
dini_IntSet(file, "Interior",GetPlayerInterior(playerid));
dini_IntSet(file, "OwnedBus",0);
dini_IntSet(file, "HasOwner",0);
BusinessInfo[busid][CP] = CreateDynamicCP(X,Y,Z,1.0,GetPlayerVirtualWorld(pl ayerid),GetPlayerInterior(playerid),-1,50.0);
format(Label, sizeof(Label), "{ccccff}%s\n{999999}No Owner\n{00BC00}Cost: {999999}$%i\nID: %i", name,cost,busid);
BusinessInfo[busid][bLabel] = Create3DTextLabel(Label,White,X,Y,Z,100.0,GetPlaye rVirtualWorld(playerid),1);
format(String,sizeof(String),"BusinessCreated. Name: %s | Cost: $%i | Owner: No Owner | ID: %i",name,cost,busid);
SendClientMessage(playerid,Green,String);
return 1;
}
------