Skripta koju koristim: ScotTee
Detaljan opis problema: Ocu da stavim jos enterijera za biz a neznam gdje pa mozete li mi reci
Dio skripte:
//==============================================================================
//==============================================================================
//====== ======= ============= ================
//========== ============ ====================== =========================
//========== ============ ====================== =========================
//========== ============ ================= ====================
//========== ============ ====================== =========================
//========== ============ ====================== =========================
//========== ============ ============= =============
//==============================================================================
//==============================================================================
//==============================================================================
//==============================================================================
//******************************************************************************
// *ScotTees Dynamic Business System*
//******************************************************************************
//Originala FS stvorena od ruke Tee, editovana SnG.Scot_MisCuDi i [ABK]Antonio
// |---------Credits:------------|
// | Zeex - Zcmd |
// | Darco - Dini |
// | Y_Less - Sscanf2 |
// | Tee - The FS |
// | SnG.Scot_MisCuDi - Edit FS |
// | [ABK]Antonio - Edit FS |
// | Incognito- Streamer plugin.|
// |-----------------------------|
#include <a_samp>
#include <zcmd>
#include <sscanf2>
/*
* Dini 1.6
* (c) Copyright 2006-2008 by DracoBlue
*
* @author : DracoBlue (http://dracoblue.com)
* @date : 13th May 2006
* @update : 16th Sep 2008
*
* This file is provided as is (no warranties).
*
* It's released under the terms of MIT.
*
* Feel free to use it, a little message in
* about box is honouring thing, isn't it?
*
*/
#if defined _dini_included
#endinput
#endif
#define _dini_included
#pragma library dini
#if defined MAX_STRING
#define DINI_MAX_STRING MAX_STRING
#else
#define DINI_MAX_STRING 255
#endif
stock dini_Exists(filename[]) {
return fexist(filename);
}
stock dini_Remove(filename[]) {
return fremove(filename);
}
stock dini_Create(filename[]) {
if (fexist(filename)) return false;
new File:fhnd;
fhnd=fopen(filename,io_write);
if (fhnd) {
fclose(fhnd);
return true;
}
return false;
}
stock dini_Set(filename[],key[],value[]) {
// If we have no key, it can't be set
// we also have no chance to set the value, if all together is bigger then the max string
new key_length = strlen(key);
new value_length = strlen(value);
if (key_length==0 || key_length+value_length+2>DINI_MAX_STRING) return false;
new File:fohnd, File:fwhnd;
new tmpres[DINI_MAX_STRING];
new bool:wasset=false;
// Let's remove the old *.part file if there was one.
format(tmpres,sizeof(tmpres),"%s.part",filename);
fremove(tmpres);
// We'll open the source file.
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
fwhnd=fopen(tmpres,io_write);
if (!fwhnd) {
// we can't open the second file for writing, so .. let's close the open one and exit.
fclose(fohnd);
return false;
}
while (fread(fohnd,tmpres)) {
if (
!wasset
&& tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
// We've got what needs to be replaced!
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
wasset=true;
} else {
DINI_StripNewLine(tmpres);
}
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
if (!wasset) {
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
fclose(fohnd);
fclose(fwhnd);
format(tmpres,sizeof(tmpres),"%s.part",filename);
if (DINI_fcopytextfile(tmpres,filename)) {
return fremove(tmpres);
}
return false;
}
stock dini_IntSet(filename[],key[],value) {
new valuestring[DINI_MAX_STRING];
format(valuestring,DINI_MAX_STRING,"%d",value);
return dini_Set(filename,key,valuestring);
}
stock dini_Int(filename[],key[]) {
return strval(dini_Get(filename,key));
}
stock dini_FloatSet(filename[],key[],Float:value) {
new valuestring[DINI_MAX_STRING];
format(valuestring,DINI_MAX_STRING,"%f",value);
return dini_Set(filename,key,valuestring);
}
stock Float:dini_Float(filename[],key[]) {
return floatstr(dini_Get(filename,key));
}
stock dini_Bool(filename[],key[]) {
return strval(dini_Get(filename,key));
}
stock dini_BoolSet(filename[],key[],value) {
if (value) {
return dini_Set(filename,key,"1");
}
return dini_Set(filename,key,"0");
}
stock dini_Unset(filename[],key[]) {
// If we have no key, it can't be set
// we also have no chance to unset the key, if all together is bigger then the max string
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return false;
new File:fohnd, File:fwhnd;
new tmpres[DINI_MAX_STRING];
// Let's remove the old *.part file if there was one.
format(tmpres,DINI_MAX_STRING,"%s.part",filename);
fremove(tmpres);
// We'll open the source file.
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
fwhnd=fopen(tmpres,io_write);
if (!fwhnd) {
// we can't open the second file for writing, so .. let's close the open one and exit.
fclose(fohnd);
return false;
}
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
// We've got what needs to be removed!
} else {
DINI_StripNewLine(tmpres);
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
}
fclose(fohnd);
fclose(fwhnd);
format(tmpres,DINI_MAX_STRING,"%s.part",filename);
if (DINI_fcopytextfile(tmpres,filename)) {
return fremove(tmpres);
}
return false;
}
stock dini_Get(filename[],key[]) {
new tmpres[DINI_MAX_STRING];
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return tmpres;
new File:fohnd;
fohnd=fopen(filename,io_read);
if (!fohnd) return tmpres;
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
/* We've got what we need */
DINI_StripNewLine(tmpres);
strmid(tmpres, tmpres, key_length + 1, strlen(tmpres), DINI_MAX_STRING);
fclose(fohnd);
return tmpres;
}
}
fclose(fohnd);
return tmpres;
}
stock dini_Isset(filename[],key[]) {
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return false;
new File:fohnd;
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
new tmpres[DINI_MAX_STRING];
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
// We've got what we need
fclose(fohnd);
return true;
}
}
fclose(fohnd);
return false;
}
stock DINI_StripNewLine(string[]) {
new len = strlen(string);
if (string[0]==0) return ;
if ((string[len - 1] == '\n') || (string[len - 1] == '\r')) {
string[len - 1] = 0;
if (string[0]==0) return ;
if ((string[len - 2] == '\n') || (string[len - 2] == '\r')) string[len - 2] = 0;
}
}
stock DINI_fcopytextfile(oldname[],newname[]) {
new File:ohnd,File:nhnd;
if (!fexist(oldname)) return false;
ohnd=fopen(oldname,io_read);
if (!ohnd) return false;
nhnd=fopen(newname,io_write);
if (!nhnd) {
fclose(ohnd);
return false;
}
new tmpres[DINI_MAX_STRING];
while (fread(ohnd,tmpres)) {
DINI_StripNewLine(tmpres);
format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
fwrite(nhnd,tmpres);
}
fclose(ohnd);
fclose(nhnd);
return true;
}
#include <streamer>
#define MAX_BUSS 100
#define NO_OWNER "INVALID_PLAYER_ID"
#define CASE_SENSETIVE true
#define White 0xFFFFFFFF
#define Yellow 0xFFFF00FF
#define Grey 0xC0C0C0FF
#define Red 0xFF0000AA
#define Green 0x45E01FFF
new cpid[32];
new String[200];
new file[128];
new Name[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
new Label[128];
new BizExit;
enum Business
{
CP,
Text3D:bLabel,
Cost,
bName[128],
}
new BusinessInfo[MAX_BUSS][Business];
forward Payday(playerid);
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
switch(IsPlayerInAnyVehicle(playerid))
{
case 0: GetPlayerFacingAngle(playerid, a);
case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
public OnFilterScriptInit()
{
print("___________________________");
print("--Dynamic Business Loaded--");
print(" --Made by: Tee-- ");
print("___________________________");
LoadBusinesses();
SetTimer("Payday",1_800_000,true);
BizExit = CreateDynamicCP(-25.9351,-141.5631,1003.5469,1,-1,16,-1,20);
return 1;
}
public OnFilterScriptExit()
{
UnloadBusinesses();
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
for(new i = 0;i<MAX_BUSS;i++)
{
if(checkpointid == BusinessInfo[i][CP])
{
cpid[playerid] = i;
format(file,sizeof(file),"Business/%i.ini",i);
if(dini_Int(file, "Ima Vlasnika") == 0)
{
ShowPlayerDialog(playerid,219,DIALOG_STYLE_MSGBOX,"Kupi Firmu","Zelis li kupiti ovu firmu?","Kupi","Odustani");
}
else
{
SetPlayerPos(playerid, -25.132598,-139.066986,1003.546875);
SetPlayerInterior(playerid, 16);
SetPlayerVirtualWorld(playerid, i);
SetPlayerFacingAngle(playerid, 359.9003);
}
}
}
if(checkpointid == BizExit)
{
format(file, sizeof(file), "Business/%i.ini", GetPlayerVirtualWorld(playerid));
SetPlayerPos(playerid, dini_Float(file, "SpawnOutX"), dini_Float(file, "SpawnOutY"), dini_Float(file, "BusZ"));
SetPlayerFacingAngle(playerid, dini_Float(file, "A"));
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 219)
{
if(response == 1)
{
if(GetPlayerBusinessID(playerid) == 1)return 0;
new busid;
format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
if(GetPlayerBusinessID(playerid) > -1)return SendClientMessage(playerid,Red,"Vec posjedujes firmu");
if(dini_Int(file,"Cost") > GetPlayerMoney(playerid))return SendClientMessage(playerid,Red,"Nemas dovoljno novaca, da bi si prisutio ovu firmu.");
GivePlayerMoney(playerid, -dini_Int(file,"Cost"));
GetPlayerName(playerid,Name,sizeof(Name));
dini_Set(file, "Name", Name);
dini_Set(file, "Owner",Name);
dini_IntSet(file, "OwnedBus",1);
dini_IntSet(file, "HasOwner",1);
format(Label, sizeof(Label), "{ccccff}%s firma\n\n{999999}%s\n{00BC00}Cjena: {999999}$%i\n{00BC00}ID: {999999}%i",Name,dini_Get(file, "Owner"),dini_Int(file, "Cost"),busid);
Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
format(String,sizeof(String),"Uspijesno ste kupili firmu: %s.",dini_Get(file, "Name"));
SendClientMessage(playerid,Green,String);
}
if(response == 0)
{
SendClientMessage(playerid,Yellow,"Odabrao si da ne kupis ovaj biznis.");
}
}
if(dialogid == 220)
{
if(response == 1)
{
GetPlayerName(playerid,Name,sizeof(Name));
format(file,sizeof(file),"Business/%i.ini",GetPlayerBusinessID(playerid));
format(Label, sizeof(Label), "{ccccff}Na prodaju!\n\n{999999}Nema vlasnika\n{00BC00}: {999999}$%i",dini_Get(file, "Name"),dini_Int(file, "Cost"));
Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
dini_Set(file, "Owner","No Owner");
dini_IntSet(file, "Cost",dini_Int(file, "Cost"));
dini_IntSet(file, "OwnedBus",0);
dini_IntSet(file, "HasOwner",0);
GivePlayerMoney(playerid,dini_Int(file, "Cost")/2);
SendClientMessage(playerid,Green,"Uspijesno ste prodali biznis, te dobili 50 posto od ukupne cjene.");
}
}
return 1;
}
// Ova komanda sluzi za pravljenje Business
COMMAND:stvorifirmu(playerid, params[])
{
new busid,cost,name[128];
new Float:x,Float:y;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"I(500000)S(Na prodaju)[128]",cost,name))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /stvorifirmu [cjena] [ime frime]");
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),"Frime/%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(playerid),GetPlayerInterior(playerid),-1,50.0);
format(Label, sizeof(Label), "{ccccff}%s\n{999999}Nema vlasnika\n{00BC00}Cjena: {999999}$%i\nID: %i", name,cost,busid);
BusinessInfo[busid][bLabel] = Create3DTextLabel(Label,White,X,Y,Z,100.0,GetPlayerVirtualWorld(playerid),1);
format(String,sizeof(String),"Firma stvorena. Ime: %s | Cjena: $%i | Vlasnik: Nema vlasnika | ID: %i",name,cost,busid);
SendClientMessage(playerid,Green,String);
return 1;
}
COMMAND:imefirme(playerid, params[])
{
new name[128];
if(sscanf(params,"s[128]",name))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /imefirme [Ime]");
if(GetPlayerBusinessID(playerid) == -1) return SendClientMessage(playerid,Red,"Ne posjedujes firmu.");
format(file,sizeof(file),"Business/%i.ini",GetPlayerBusinessID(playerid));
dini_Set(file, "Name", name);
format(String,sizeof(String),"Ime firme promjenjeno u: %s",name);
SendClientMessage(playerid,Green,String);
format(Label, sizeof(Label), "{ccccff}%s\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",name, dini_Get(file, "Owner"),dini_Int(file, "Cost"),GetPlayerBusinessID(playerid));
Update3DTextLabelText(BusinessInfo[GetPlayerBusinessID(playerid)][bLabel],White,Label);
return 1;
}
//Ova komanda koristi se za brisanje firme
COMMAND:brisifirmu(playerid, params[])
{
new busid;
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params, "i", busid)) return SendClientMessage(playerid,0xC0C0C0FF,"Koristi: /brisifirmu [ID firme]");
format(file,sizeof(file),"Business/%i.ini",busid);
if(!dini_Exists(file))return SendClientMessage(playerid,Red,"Ta firma ne postoji.");
format(String,sizeof(String),"Uspijesno ste maknuli firmu ID-a: %i.",busid);
SendClientMessage(playerid,Yellow,String);
DestroyDynamicCP(BusinessInfo[busid][CP]);
Delete3DTextLabel(BusinessInfo[busid][bLabel]);
dini_Remove(file);
return 1;
}
//Ova komanda omogucuje da owner proda svoju firmu
COMMAND:prodajfirmu(playerid, params[])
{
if(GetPlayerBusinessID(playerid) == -1)return SendClientMessage(playerid,Red,"Ne posjedujes biznis.");
ShowPlayerDialog(playerid,220,DIALOG_STYLE_MSGBOX,"Prodaja firme","Zelis li prodati firmu?","Prodaj","Odustani");
return 1;
}
//This function gets the owner of a specific business.
stock GetBusOwner(bussid)
{
new owner[MAX_PLAYER_NAME];
format(owner, MAX_PLAYER_NAME, NO_OWNER);
format(String, sizeof(String), "Business/%i.ini", bussid);
if(dini_Exists(String))
{
format(owner, MAX_PLAYER_NAME, "%s", dini_Get(String, "Owner"));
return owner;
}
return owner;
}
//This function gets a business ID (it also tells if a player owns a business or not).
stock GetPlayerBusinessID(playerid)
{
new returnval, found=0;
for(new i = 0;i<MAX_BUSS;i++)
{
format(String,sizeof(String),"Business/%i.ini",i);
if(dini_Exists(String))
{
GetPlayerName(playerid,Name,sizeof(Name));
if(!strcmp(Name, dini_Get(String,"Owner"), false))
{
returnval = i;
found = 1;
}
}
}
if(!found) returnval = -1;
return returnval;
}
//Ova komanda omogucuje da se skloni owner biza
COMMAND:defirma(playerid, params[])
{
new id;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /defirma [id]");
if(GetPlayerBusinessID(id) == -1)return SendClientMessage(playerid,Red,"Taj igraci ne posjeduje biz.");
format(String,sizeof(String),"Business/%i.ini",GetPlayerBusinessID(id));
format(Label, sizeof(Label), "{ccccff}%s\n{999999}Nema vlasnika\n{00BC00}Cjena: {999999}$%i",dini_Get(String, "Name"),dini_Int(String, "Cost"));
Update3DTextLabelText(BusinessInfo[GetPlayerBusinessID(id)][bLabel],White,Label);
dini_Set(String, "Owner","No Owner");
dini_IntSet(String, "Cost",dini_Int(String, "Cost"));
dini_IntSet(String, "OwnedBus",0);
dini_IntSet(String, "HasOwner",0);
GivePlayerMoney(id,dini_Int(String, "Cost")/4);
format(String, sizeof(String), "Igrac %s vise nije vlasnik firme.",Name);
SendClientMessage(playerid,Red, String);
return 1;
}
//This function loads every business.
stock LoadBusinesses()
{
new count = 0;
for(new i=0; i<MAX_BUSS; i++)
{
format(String,sizeof(String),"Business/%i.ini",i); // the ID would be the name of the file, 1 2 3 4 5 etc
if(dini_Exists(String)) //thats the easiest way to get IDs of them, you don't need to write it inside of the file itself if the name of the file is a number.. looks good?
{
BusinessInfo[i][CP] = CreateDynamicCP(dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ"),1.0,dini_Int(String, "World"),dini_Int(String, "Interior"),-1,100.0);
if(!strcmp(GetBusOwner(i), NO_OWNER, CASE_SENSETIVE))
{
format(Label, sizeof(Label), "{ccccff}%s\n{999999}No Owner\n{00BC00}Cost: {999999}$%i",dini_Get(String, "Name"),dini_Int(String, "Cost"));
BusinessInfo[i][bLabel] = Create3DTextLabel(Label,White,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")+1,100.0,0,1);
}
if(strcmp(GetBusOwner(i), NO_OWNER, CASE_SENSETIVE))//i will be what index it's at in the loop which would be the ID as its looping through all the files
{
format(Label, sizeof(Label), "{ccccff}%s\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",dini_Get(String, "Name"), dini_Get(String, "Owner"),dini_Int(String, "Cost"),i);
BusinessInfo[i][bLabel] = Create3DTextLabel(Label,White,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")+1,100.0,0,1);
}
count++;
}
}
return printf("Total Businesses Loaded: %i",count);
}
//This function gets the last bused business ID.
stock GetLastBusinessID()
{
new count = 0;
for(new i=0; i<MAX_BUSS; i++)
{
format(String,sizeof(String),"Business/%i.ini",i);
{
count++;
}
}
return count;
}
//This function unloads every business.
stock UnloadBusinesses()
{
for(new i=0; i<MAX_BUSS; i++)
{
Delete3DTextLabel(BusinessInfo[i][bLabel]);
DestroyDynamicCP(BusinessInfo[i][CP]);
}
return 1;
}
//This is used by RCON admins. Either to debug or to force a payday.
COMMAND:ubrzajpay(playerid,params[])
{
if(!IsPlayerAdmin(playerid))return 0;
SendClientMessage(playerid,Grey,"Ubrzali ste payday.");
for(new i=0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) Payday(i);
return 1;
}
#define TIMEDEBUG 1 //set this to 0 if you don't want it to print the time it took for this function to execute
//This function is the payday (to pay the owners).
public Payday(playerid)
{
#if TIMEDEBUG == 1
new tick = GetTickCount();
#endif
if(GetPlayerBusinessID(playerid) != -1)
{
new RandMoney = rand(100_000, 250_000), msg[128];
GivePlayerMoney(playerid, RandMoney);
format(msg, sizeof(msg), "[FIRMA] Primili ste $%i", RandMoney);
SendClientMessage(playerid, Green, msg);
format(msg, sizeof(msg), "~w~Primili ste ~g~$%i ~w~iz vase firme", RandMoney);
GameTextForPlayer(playerid, msg, 4000,3);
}
else return SendClientMessage(playerid, Green, "Da imate firmu, primili biste payday!");
#if TIMEDEBUG == 1
printf("Time taken to execute Payday(): %i", GetTickCount()-tick);
#endif
return 1;
}
stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
stock rand(minnum = cellmin,maxnum = cellmax) return random(maxnum - minnum + 1) + minnum; //swtiches so much better
Neke slike/video za lakse dobivanje pomoci(neobavezno): /
Da u ovu gore skriptu ubacim ove eterijere i kad kucam /stvorifirmu da mi napise sta imam i samo stavim id i to je to
if(BizzInfo[houseid][bSetted] == 0)
{
new string2[256];
new Kucajtee;
format(string, sizeof(string),"server uklonjen!RP/Bizzes/%d.ini",houseid);
dini_Create(string);
if(sscanf(params, "i", Kucajtee))
{
SCM(playerid, COLOR_GRAD2, "Koriscenje: /setbizz [kucajte]");
SCM(playerid, COLOR_GRAD2, "Kucajte: 0 (Cluckin Bell) - 1 (Burger Shoot) - 2 (Pizza Stack) - 3 (Donut Shop) - 4 (24-7) - 5 (Strip Club) - 6 (Bar) - 7 (Gym)");
SCM(playerid, COLOR_GRAD2, "Kucajte: 8 (Sex Shop) - 9 (Binco) - 10 (Ammunation) - 11 (Disco) - 12 (Restaurant) - 13 (ZIP) - 14(Victom) - 15 (Sub Urban) - 16 (Trafika) - 17 (Prodavnica Mobilni Telefona)");
return 1;
}
if(Kucajtee == 0) // Cluckin
{
BizzInfo[houseid][bExitX] = 365.server uklonjen!96;
BizzInfo[houseid][bExitY] = -9.169898;
BizzInfo[houseid][bExitZ] = 1001.851623;
BizzInfo[houseid][bBuyPrice] = 325000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 9;
BizzInfo[houseid][bInteriorNr] = 20;
strmid(BizzInfo[houseid][bMessage],"Cluckin' Bell",0,strlen("Cluckin' Bell"),255);
}
else if(Kucajtee == 1) // Burger
{
BizzInfo[houseid][bExitX] = 363.217712;
BizzInfo[houseid][bExitY] = -74.911697;
BizzInfo[houseid][bExitZ] = 1001.507812;
BizzInfo[houseid][bBuyPrice] = 325000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 10;
BizzInfo[houseid][bInteriorNr] = 21;
strmid(BizzInfo[houseid][bMessage],"Burger Shoot",0,strlen("Burger Shoot"),255);
}
else if(Kucajtee == 2) // Pizza
{
BizzInfo[houseid][bExitX] = 372.411712;
BizzInfo[houseid][bExitY] = -130.457702;
BizzInfo[houseid][bExitZ] = 1001.492187;
BizzInfo[houseid][bBuyPrice] = 325000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 5;
BizzInfo[houseid][bInteriorNr] = 22;
strmid(BizzInfo[houseid][bMessage],"Pizza Shop",0,strlen("Pizza Shop"),255);
}
else if(Kucajtee == 3) // Donut
{
BizzInfo[houseid][bExitX] = 377.172393;
BizzInfo[houseid][bExitY] = -193.304504;
BizzInfo[houseid][bExitZ] = 1000.632812;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 17;
BizzInfo[houseid][bInteriorNr] = 30;
strmid(BizzInfo[houseid][bMessage],"Donut Shop",0,strlen("Donut Shop"),255);
}
else if(Kucajtee == 4) // 24-7
{
if(nextshop == 1)
{
BizzInfo[houseid][bExitX] = -25.132600;
BizzInfo[houseid][bExitY] = -139.067001;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 16;
nextshop ++;
}
else if(nextshop == 2)
{
BizzInfo[houseid][bExitX] = -28.261899;
BizzInfo[houseid][bExitY] = -31.767400;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 4;
nextshop ++;
}
else if(nextshop == 3)
{
BizzInfo[houseid][bExitX] = -27.391899;
BizzInfo[houseid][bExitY] = -58.252899;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 6;
nextshop ++;
}
else if(nextshop == 4)
{
BizzInfo[houseid][bExitX] = -30.929899;
BizzInfo[houseid][bExitY] = -92.011398;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 18;
nextshop = 1;
}
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 5;
BizzInfo[houseid][bInteriorNr] = 12;
strmid(BizzInfo[houseid][bMessage],"24-7",0,strlen("24-7"),255);
}
else if(Kucajtee == 5) // Pig Pen
{
BizzInfo[houseid][bExitX] = 1204.846191;
BizzInfo[houseid][bExitY] = -13.852100;
BizzInfo[houseid][bExitZ] = 1000.921875;
BizzInfo[houseid][bBuyPrice] = 385000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 2;
BizzInfo[houseid][bInteriorNr] = 17;
strmid(BizzInfo[houseid][bMessage],"Strip Club",0,strlen("Strip Club"),255);
}
else if(Kucajtee == 6) // Bar
{
BizzInfo[houseid][bExitX] = 501.870788;
BizzInfo[houseid][bExitY] = -67.582000;
BizzInfo[houseid][bExitZ] = 998.757812;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 11;
BizzInfo[houseid][bInteriorNr] = 26;
strmid(BizzInfo[houseid][bMessage],"Bar",0,strlen("Bar"),255);
}
else if(Kucajtee == 7) // Gym
{
BizzInfo[houseid][bExitX] = 772.359375;
BizzInfo[houseid][bExitY] = -5.515697;
BizzInfo[houseid][bExitZ] = 1000.728576;
BizzInfo[houseid][bBuyPrice] = 400000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 5;
BizzInfo[houseid][bInteriorNr] = 15;
strmid(BizzInfo[houseid][bMessage],"Gym",0,strlen("Gym"),255);
}
else if(Kucajtee == 8) // Sex Shop
{
BizzInfo[houseid][bExitX] = -100.295700;
BizzInfo[houseid][bExitY] = -24.654399;
BizzInfo[houseid][bExitZ] = 1000.718811;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 5;
BizzInfo[houseid][bInterior] = 3;
BizzInfo[houseid][bInteriorNr] = 34;
strmid(BizzInfo[houseid][bMessage],"Sex Shop",0,strlen("Sex Shop"),255);
}
else if(Kucajtee == 9) // Binco
{
BizzInfo[houseid][bExitX] = 207.766204;
BizzInfo[houseid][bExitY] = -111.266296;
BizzInfo[houseid][bExitZ] = 1005.132812;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 15;
BizzInfo[houseid][bInteriorNr] = 16;
strmid(BizzInfo[houseid][bMessage],"Binco",0,strlen("Binco"),255);
}
else if(Kucajtee == 10) // Ammunation
{
BizzInfo[houseid][bExitX] = 315.762786;
BizzInfo[houseid][bExitY] = -143.661193;
BizzInfo[houseid][bExitZ] = 999.601623;
BizzInfo[houseid][bBuyPrice] = 750000;
BizzInfo[houseid][bLevelNeeded] = 10;
BizzInfo[houseid][bInterior] = 7;
BizzInfo[houseid][bInteriorNr] = 14;
strmid(BizzInfo[houseid][bMessage],"Ammunation",0,strlen("Ammunation"),255);
}
else if(Kucajtee == 11) // Disco
{
BizzInfo[houseid][bExitX] = 493.439300;
BizzInfo[houseid][bExitY] = -24.916900;
BizzInfo[houseid][bExitZ] = 1000.671875;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 17;
BizzInfo[houseid][bInteriorNr] = 18;
strmid(BizzInfo[houseid][bMessage],"Disco",0,strlen("Disco"),255);
}
else if(Kucajtee == 12) // Restaurant
{
BizzInfo[houseid][bExitX] = 460.265411;
BizzInfo[houseid][bExitY] = -88.611503;
BizzInfo[houseid][bExitZ] = 999.554687;
BizzInfo[houseid][bBuyPrice] = 300000;
BizzInfo[houseid][bLevelNeeded] = 5;
BizzInfo[houseid][bInterior] = 4;
BizzInfo[houseid][bInteriorNr] = 38;
strmid(BizzInfo[houseid][bMessage],"Restaurant",0,strlen("Restaurant"),255);
}
else if(Kucajtee == 13) // ZIP
{
BizzInfo[houseid][bExitX] = 161.410293;
BizzInfo[houseid][bExitY] = -96.687202;
BizzInfo[houseid][bExitZ] = 1001.804687;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 18;
BizzInfo[houseid][bInteriorNr] = 36;
strmid(BizzInfo[houseid][bMessage],"ZIP",0,strlen("ZIP"),255);
}
else if(Kucajtee == 14) // Victim
{
BizzInfo[houseid][bExitX] = 227.342803;
BizzInfo[houseid][bExitY] = -8.243800;
BizzInfo[houseid][bExitZ] = 1002.210876;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 5;
BizzInfo[houseid][bInteriorNr] = 37;
strmid(BizzInfo[houseid][bMessage],"Victim",0,strlen("Victim"),255);
}
else if(Kucajtee == 15) // Suburban
{
BizzInfo[houseid][bExitX] = 203.895294;
BizzInfo[houseid][bExitY] = -50.656700;
BizzInfo[houseid][bExitZ] = 1001.804687;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 1;
BizzInfo[houseid][bInteriorNr] = 35;
strmid(BizzInfo[houseid][bMessage],"Sub urban",0,strlen("Sub urban"),255);
}
else if(Kucajtee == 16) // Trafika
{
BizzInfo[houseid][bExitX] = 203.895294;
BizzInfo[houseid][bExitY] = -50.656700;
BizzInfo[houseid][bExitZ] = 1001.804687;
BizzInfo[houseid][bBuyPrice] = 45000;
BizzInfo[houseid][bLevelNeeded] = 4;
BizzInfo[houseid][bInterior] = 0;
BizzInfo[houseid][bInteriorNr] = 35;
BizzInfo[houseid][bTrafika] = 1;
strmid(BizzInfo[houseid][bMessage],"Trafika",0,strlen("Trafika"),255);
}
else if(Kucajtee == 17) // Prodavnica mobilnih
{
BizzInfo[houseid][bExitX] = 1554.3765;
BizzInfo[houseid][bExitY] = 101.8853;
BizzInfo[houseid][bExitZ] = 977.2898;
BizzInfo[houseid][bBuyPrice] = 200000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 0;
BizzInfo[houseid][bInteriorNr] = 0;
BizzInfo[houseid][bMobilni] = 1;
strmid(BizzInfo[houseid][bMessage],"Prodavnica Mobilnih Telefona",0,strlen("Prodavnica Mobilnih Telefona"),255);
}
Oce li mi ko pomoc da sastavim ovo?
Jednostanvno uvedes nov broj ako unese.
Ovde samo dodas koji je to broj da znas kada pravis:
if(sscanf(params, "i", Kucajtee))
{
SCM(playerid, COLOR_GRAD2, "Koriscenje: /setbizz [kucajte]");
SCM(playerid, COLOR_GRAD2, "Kucajte: 0 (Cluckin Bell) - 1 (Burger Shoot) - 2 (Pizza Stack) - 3 (Donut Shop) - 4 (24-7) - 5 (Strip Club) - 6 (Bar) - 7 (Gym)");
SCM(playerid, COLOR_GRAD2, "Kucajte: 8 (Sex Shop) - 9 (Binco) - 10 (Ammunation) - 11 (Disco) - 12 (Restaurant) - 13 (ZIP) - 14(Victom) - 15 (Sub Urban) - 16 (Trafika) - 17 (Prodavnica Mobilni Telefona)");
SCM(playerid, COLOR_GRAD2, "Kucajte: 18 (Nesto) - 19 (Nesto)");
return 1;
}
I onda samo dodas jos posle onog else if(Kucajtee == 17)
primer:
else if(Kucajtee == 18) // Trafika
{
BizzInfo[houseid][bExitX] = X;//Koordinate X
BizzInfo[houseid][bExitY] = Y;//Koordinate Y
BizzInfo[houseid][bExitZ] = Z;//Koordinate Z
BizzInfo[houseid][bBuyPrice] = Cena;//Cena
BizzInfo[houseid][bLevelNeeded] = Level;//Level
BizzInfo[houseid][bInterior] = IntID;//Isto promeni sta to treba da bude
BizzInfo[houseid][bInteriorNr] = 35;//Isto promenis
strmid(BizzInfo[houseid][bMessage],"Sta je biz",0,strlen("Sta je biz"),255);//Stavis sta je biz kao ono Trafika
}
Samo MORAS promeniti to sto sam stavljao komentar tacnije vecinu :)
Tako isto dodaje jos i slicno
Nisi me razumio,da u ovu FS
//==============================================================================
//==============================================================================
//====== ======= ============= ================
//========== ============ ====================== =========================
//========== ============ ====================== =========================
//========== ============ ================= ====================
//========== ============ ====================== =========================
//========== ============ ====================== =========================
//========== ============ ============= =============
//==============================================================================
//==============================================================================
//==============================================================================
//==============================================================================
//******************************************************************************
// *ScotTees Dynamic Business System*
//******************************************************************************
//Originala FS stvorena od ruke Tee, editovana SnG.Scot_MisCuDi i [ABK]Antonio
// |---------Credits:------------|
// | Zeex - Zcmd |
// | Darco - Dini |
// | Y_Less - Sscanf2 |
// | Tee - The FS |
// | SnG.Scot_MisCuDi - Edit FS |
// | [ABK]Antonio - Edit FS |
// | Incognito- Streamer plugin.|
// |-----------------------------|
#include <a_samp>
#include <zcmd>
#include <sscanf2>
/*
* Dini 1.6
* (c) Copyright 2006-2008 by DracoBlue
*
* @author : DracoBlue (http://dracoblue.com)
* @date : 13th May 2006
* @update : 16th Sep 2008
*
* This file is provided as is (no warranties).
*
* It's released under the terms of MIT.
*
* Feel free to use it, a server uklonjen! message in
* about box is honouring thing, isn't it?
*
*/
#if defined _dini_included
#endinput
#endif
#define _dini_included
#pragma library dini
#if defined MAX_STRING
#define DINI_MAX_STRING MAX_STRING
#else
#define DINI_MAX_STRING 255
#endif
stock dini_Exists(filename[]) {
return fexist(filename);
}
stock dini_Remove(filename[]) {
return fremove(filename);
}
stock dini_Create(filename[]) {
if (fexist(filename)) return false;
new File:fhnd;
fhnd=fopen(filename,io_write);
if (fhnd) {
fclose(fhnd);
return true;
}
return false;
}
stock dini_Set(filename[],key[],value[]) {
// If we have no key, it can't be set
// we also have no chance to set the value, if all together is bigger then the max string
new key_length = strlen(key);
new value_length = strlen(value);
if (key_length==0 || key_length+value_length+2>DINI_MAX_STRING) return false;
new File:fohnd, File:fwhnd;
new tmpres[DINI_MAX_STRING];
new bool:wasset=false;
// Let's remove the old *.part file if there was one.
format(tmpres,sizeof(tmpres),"%s.part",filename);
fremove(tmpres);
// We'll open the source file.
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
fwhnd=fopen(tmpres,io_write);
if (!fwhnd) {
// we can't open the second file for writing, so .. let's close the open one and exit.
fclose(fohnd);
return false;
}
while (fread(fohnd,tmpres)) {
if (
!wasset
&& tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
// We've got what needs to be replaced!
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
wasset=true;
} else {
DINI_StripNewLine(tmpres);
}
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
if (!wasset) {
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
fclose(fohnd);
fclose(fwhnd);
format(tmpres,sizeof(tmpres),"%s.part",filename);
if (DINI_fcopytextfile(tmpres,filename)) {
return fremove(tmpres);
}
return false;
}
stock dini_IntSet(filename[],key[],value) {
new valuestring[DINI_MAX_STRING];
format(valuestring,DINI_MAX_STRING,"%d",value);
return dini_Set(filename,key,valuestring);
}
stock dini_Int(filename[],key[]) {
return strval(dini_Get(filename,key));
}
stock dini_FloatSet(filename[],key[],Float:value) {
new valuestring[DINI_MAX_STRING];
format(valuestring,DINI_MAX_STRING,"%f",value);
return dini_Set(filename,key,valuestring);
}
stock Float:dini_Float(filename[],key[]) {
return floatstr(dini_Get(filename,key));
}
stock dini_Bool(filename[],key[]) {
return strval(dini_Get(filename,key));
}
stock dini_BoolSet(filename[],key[],value) {
if (value) {
return dini_Set(filename,key,"1");
}
return dini_Set(filename,key,"0");
}
stock dini_Unset(filename[],key[]) {
// If we have no key, it can't be set
// we also have no chance to unset the key, if all together is bigger then the max string
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return false;
new File:fohnd, File:fwhnd;
new tmpres[DINI_MAX_STRING];
// Let's remove the old *.part file if there was one.
format(tmpres,DINI_MAX_STRING,"%s.part",filename);
fremove(tmpres);
// We'll open the source file.
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
fwhnd=fopen(tmpres,io_write);
if (!fwhnd) {
// we can't open the second file for writing, so .. let's close the open one and exit.
fclose(fohnd);
return false;
}
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
// We've got what needs to be removed!
} else {
DINI_StripNewLine(tmpres);
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
}
fclose(fohnd);
fclose(fwhnd);
format(tmpres,DINI_MAX_STRING,"%s.part",filename);
if (DINI_fcopytextfile(tmpres,filename)) {
return fremove(tmpres);
}
return false;
}
stock dini_Get(filename[],key[]) {
new tmpres[DINI_MAX_STRING];
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return tmpres;
new File:fohnd;
fohnd=fopen(filename,io_read);
if (!fohnd) return tmpres;
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
/* We've got what we need */
DINI_StripNewLine(tmpres);
strmid(tmpres, tmpres, key_length + 1, strlen(tmpres), DINI_MAX_STRING);
fclose(fohnd);
return tmpres;
}
}
fclose(fohnd);
return tmpres;
}
stock dini_Isset(filename[],key[]) {
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return false;
new File:fohnd;
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
new tmpres[DINI_MAX_STRING];
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
// We've got what we need
fclose(fohnd);
return true;
}
}
fclose(fohnd);
return false;
}
stock DINI_StripNewLine(string[]) {
new len = strlen(string);
if (string[0]==0) return ;
if ((string[len - 1] == '\n') || (string[len - 1] == '\r')) {
string[len - 1] = 0;
if (string[0]==0) return ;
if ((string[len - 2] == '\n') || (string[len - 2] == '\r')) string[len - 2] = 0;
}
}
stock DINI_fcopytextfile(oldname[],newname[]) {
new File:ohnd,File:nhnd;
if (!fexist(oldname)) return false;
ohnd=fopen(oldname,io_read);
if (!ohnd) return false;
nhnd=fopen(newname,io_write);
if (!nhnd) {
fclose(ohnd);
return false;
}
new tmpres[DINI_MAX_STRING];
while (fread(ohnd,tmpres)) {
DINI_StripNewLine(tmpres);
format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
fwrite(nhnd,tmpres);
}
fclose(ohnd);
fclose(nhnd);
return true;
}
#include <streamer>
#define MAX_BUSS 100
#define NO_OWNER "INVALID_PLAYER_ID"
#define CASE_SENSETIVE true
#define White 0xFFFFFFFF
#define Yellow 0xFFFF00FF
#define Grey 0xC0C0C0FF
#define Red 0xFF0000AA
#define Green 0x45E01FFF
new cpid[32];
new String[200];
new file[128];
new Name[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
new Label[128];
new BizExit;
enum Business
{
CP,
Text3D:bLabel,
Cost,
bName[128],
}
new BusinessInfo[MAX_BUSS][Business];
forward Payday(playerid);
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
switch(IsPlayerInAnyVehicle(playerid))
{
case 0: GetPlayerFacingAngle(playerid, a);
case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
public OnFilterScriptInit()
{
print("___________________________");
print("--Dynamic Business Loaded--");
print(" --Made by: Tee-- ");
print("___________________________");
LoadBusinesses();
SetTimer("Payday",1_800_000,true);
BizExit = CreateDynamicCP(-25.9351,-141.5631,1003.5469,1,-1,16,-1,20);
return 1;
}
public OnFilterScriptExit()
{
UnloadBusinesses();
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
for(new i = 0;i<MAX_BUSS;i++)
{
if(checkpointid == BusinessInfo[i][CP])
{
cpid[playerid] = i;
format(file,sizeof(file),"Business/%i.ini",i);
if(dini_Int(file, "Ima Vlasnika") == 0)
{
ShowPlayerDialog(playerid,219,DIALOG_STYLE_MSGBOX,"Kupi Firmu","Zelis li kupiti ovu firmu?","Kupi","Odustani");
}
else
{
SetPlayerPos(playerid, -25.132598,-139.066986,1003.546875);
SetPlayerInterior(playerid, 16);
SetPlayerVirtualWorld(playerid, i);
SetPlayerFacingAngle(playerid, 359.9003);
}
}
}
if(checkpointid == BizExit)
{
format(file, sizeof(file), "Business/%i.ini", GetPlayerVirtualWorld(playerid));
SetPlayerPos(playerid, dini_Float(file, "SpawnOutX"), dini_Float(file, "SpawnOutY"), dini_Float(file, "BusZ"));
SetPlayerFacingAngle(playerid, dini_Float(file, "A"));
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 219)
{
if(response == 1)
{
if(GetPlayerBusinessID(playerid) == 1)return 0;
new busid;
format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
if(GetPlayerBusinessID(playerid) > -1)return SendClientMessage(playerid,Red,"Vec posjedujes firmu");
if(dini_Int(file,"Cost") > GetPlayerMoney(playerid))return SendClientMessage(playerid,Red,"Nemas dovoljno novaca, da bi si prisutio ovu firmu.");
GivePlayerMoney(playerid, -dini_Int(file,"Cost"));
GetPlayerName(playerid,Name,sizeof(Name));
dini_Set(file, "Name", Name);
dini_Set(file, "Owner",Name);
dini_IntSet(file, "OwnedBus",1);
dini_IntSet(file, "HasOwner",1);
format(Label, sizeof(Label), "{ccccff}%s firma\n\n{999999}%s\n{00BC00}Cjena: {999999}$%i\n{00BC00}ID: {999999}%i",Name,dini_Get(file, "Owner"),dini_Int(file, "Cost"),busid);
Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
format(String,sizeof(String),"Uspijesno ste kupili firmu: %s.",dini_Get(file, "Name"));
SendClientMessage(playerid,Green,String);
}
if(response == 0)
{
SendClientMessage(playerid,Yellow,"Odabrao si da ne kupis ovaj biznis.");
}
}
if(dialogid == 220)
{
if(response == 1)
{
GetPlayerName(playerid,Name,sizeof(Name));
format(file,sizeof(file),"Business/%i.ini",GetPlayerBusinessID(playerid));
format(Label, sizeof(Label), "{ccccff}Na prodaju!\n\n{999999}Nema vlasnika\n{00BC00}: {999999}$%i",dini_Get(file, "Name"),dini_Int(file, "Cost"));
Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
dini_Set(file, "Owner","No Owner");
dini_IntSet(file, "Cost",dini_Int(file, "Cost"));
dini_IntSet(file, "OwnedBus",0);
dini_IntSet(file, "HasOwner",0);
GivePlayerMoney(playerid,dini_Int(file, "Cost")/2);
SendClientMessage(playerid,Green,"Uspijesno ste prodali biznis, te dobili 50 posto od ukupne cjene.");
}
}
return 1;
}
// Ova komanda sluzi za pravljenje Business
COMMAND:stvorifirmu(playerid, params[])
{
new busid,cost,name[128];
new Float:x,Float:y;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"I(500000)S(Na prodaju)[128]",cost,name))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /stvorifirmu [cjena] [ime frime]");
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),"Frime/%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(playerid),GetPlayerInterior(playerid),-1,50.0);
format(Label, sizeof(Label), "{ccccff}%s\n{999999}Nema vlasnika\n{00BC00}Cjena: {999999}$%i\nID: %i", name,cost,busid);
BusinessInfo[busid][bLabel] = Create3DTextLabel(Label,White,X,Y,Z,100.0,GetPlayerVirtualWorld(playerid),1);
format(String,sizeof(String),"Firma stvorena. Ime: %s | Cjena: $%i | Vlasnik: Nema vlasnika | ID: %i",name,cost,busid);
SendClientMessage(playerid,Green,String);
return 1;
}
COMMAND:imefirme(playerid, params[])
{
new name[128];
if(sscanf(params,"s[128]",name))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /imefirme [Ime]");
if(GetPlayerBusinessID(playerid) == -1) return SendClientMessage(playerid,Red,"Ne posjedujes firmu.");
format(file,sizeof(file),"Business/%i.ini",GetPlayerBusinessID(playerid));
dini_Set(file, "Name", name);
format(String,sizeof(String),"Ime firme promjenjeno u: %s",name);
SendClientMessage(playerid,Green,String);
format(Label, sizeof(Label), "{ccccff}%s\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",name, dini_Get(file, "Owner"),dini_Int(file, "Cost"),GetPlayerBusinessID(playerid));
Update3DTextLabelText(BusinessInfo[GetPlayerBusinessID(playerid)][bLabel],White,Label);
return 1;
}
//Ova komanda koristi se za brisanje firme
COMMAND:brisifirmu(playerid, params[])
{
new busid;
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params, "i", busid)) return SendClientMessage(playerid,0xC0C0C0FF,"Koristi: /brisifirmu [ID firme]");
format(file,sizeof(file),"Business/%i.ini",busid);
if(!dini_Exists(file))return SendClientMessage(playerid,Red,"Ta firma ne postoji.");
format(String,sizeof(String),"Uspijesno ste maknuli firmu ID-a: %i.",busid);
SendClientMessage(playerid,Yellow,String);
DestroyDynamicCP(BusinessInfo[busid][CP]);
Delete3DTextLabel(BusinessInfo[busid][bLabel]);
dini_Remove(file);
return 1;
}
//Ova komanda omogucuje da owner proda svoju firmu
COMMAND:prodajfirmu(playerid, params[])
{
if(GetPlayerBusinessID(playerid) == -1)return SendClientMessage(playerid,Red,"Ne posjedujes biznis.");
ShowPlayerDialog(playerid,220,DIALOG_STYLE_MSGBOX,"Prodaja firme","Zelis li prodati firmu?","Prodaj","Odustani");
return 1;
}
//This function gets the owner of a specific business.
stock GetBusOwner(bussid)
{
new owner[MAX_PLAYER_NAME];
format(owner, MAX_PLAYER_NAME, NO_OWNER);
format(String, sizeof(String), "Business/%i.ini", bussid);
if(dini_Exists(String))
{
format(owner, MAX_PLAYER_NAME, "%s", dini_Get(String, "Owner"));
return owner;
}
return owner;
}
//This function gets a business ID (it also tells if a player owns a business or not).
stock GetPlayerBusinessID(playerid)
{
new returnval, found=0;
for(new i = 0;i<MAX_BUSS;i++)
{
format(String,sizeof(String),"Business/%i.ini",i);
if(dini_Exists(String))
{
GetPlayerName(playerid,Name,sizeof(Name));
if(!strcmp(Name, dini_Get(String,"Owner"), false))
{
returnval = i;
found = 1;
}
}
}
if(!found) returnval = -1;
return returnval;
}
//Ova komanda omogucuje da se skloni owner biza
COMMAND:defirma(playerid, params[])
{
new id;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /defirma [id]");
if(GetPlayerBusinessID(id) == -1)return SendClientMessage(playerid,Red,"Taj igraci ne posjeduje biz.");
format(String,sizeof(String),"Business/%i.ini",GetPlayerBusinessID(id));
format(Label, sizeof(Label), "{ccccff}%s\n{999999}Nema vlasnika\n{00BC00}Cjena: {999999}$%i",dini_Get(String, "Name"),dini_Int(String, "Cost"));
Update3DTextLabelText(BusinessInfo[GetPlayerBusinessID(id)][bLabel],White,Label);
dini_Set(String, "Owner","No Owner");
dini_IntSet(String, "Cost",dini_Int(String, "Cost"));
dini_IntSet(String, "OwnedBus",0);
dini_IntSet(String, "HasOwner",0);
GivePlayerMoney(id,dini_Int(String, "Cost")/4);
format(String, sizeof(String), "Igrac %s vise nije vlasnik firme.",Name);
SendClientMessage(playerid,Red, String);
return 1;
}
//This function loads every business.
stock LoadBusinesses()
{
new count = 0;
for(new i=0; i<MAX_BUSS; i++)
{
format(String,sizeof(String),"Business/%i.ini",i); // the ID would be the name of the file, 1 2 3 4 5 etc
if(dini_Exists(String)) //thats the easiest way to get IDs of them, you don't need to write it inside of the file itself if the name of the file is a number.. looks good?
{
BusinessInfo[i][CP] = CreateDynamicCP(dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ"),1.0,dini_Int(String, "World"),dini_Int(String, "Interior"),-1,100.0);
if(!strcmp(GetBusOwner(i), NO_OWNER, CASE_SENSETIVE))
{
format(Label, sizeof(Label), "{ccccff}%s\n{999999}No Owner\n{00BC00}Cost: {999999}$%i",dini_Get(String, "Name"),dini_Int(String, "Cost"));
BusinessInfo[i][bLabel] = Create3DTextLabel(Label,White,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")+1,100.0,0,1);
}
if(strcmp(GetBusOwner(i), NO_OWNER, CASE_SENSETIVE))//i will be what index it's at in the loop which would be the ID as its looping through all the files
{
format(Label, sizeof(Label), "{ccccff}%s\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",dini_Get(String, "Name"), dini_Get(String, "Owner"),dini_Int(String, "Cost"),i);
BusinessInfo[i][bLabel] = Create3DTextLabel(Label,White,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")+1,100.0,0,1);
}
count++;
}
}
return printf("Total Businesses Loaded: %i",count);
}
//This function gets the last bused business ID.
stock GetLastBusinessID()
{
new count = 0;
for(new i=0; i<MAX_BUSS; i++)
{
format(String,sizeof(String),"Business/%i.ini",i);
{
count++;
}
}
return count;
}
//This function unloads every business.
stock UnloadBusinesses()
{
for(new i=0; i<MAX_BUSS; i++)
{
Delete3DTextLabel(BusinessInfo[i][bLabel]);
DestroyDynamicCP(BusinessInfo[i][CP]);
}
return 1;
}
//This is used by RCON admins. Either to debug or to force a payday.
COMMAND:ubrzajpay(playerid,params[])
{
if(!IsPlayerAdmin(playerid))return 0;
SendClientMessage(playerid,Grey,"Ubrzali ste payday.");
for(new i=0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) Payday(i);
return 1;
}
#define TIMEDEBUG 1 //set this to 0 if you don't want it to print the time it took for this function to execute
//This function is the payday (to pay the owners).
public Payday(playerid)
{
#if TIMEDEBUG == 1
new tick = GetTickCount();
#endif
if(GetPlayerBusinessID(playerid) != -1)
{
new RandMoney = rand(100_000, 250_000), msg[128];
GivePlayerMoney(playerid, RandMoney);
format(msg, sizeof(msg), "[FIRMA] Primili ste $%i", RandMoney);
SendClientMessage(playerid, Green, msg);
format(msg, sizeof(msg), "~w~Primili ste ~g~$%i ~w~iz vase firme", RandMoney);
GameTextForPlayer(playerid, msg, 4000,3);
}
else return SendClientMessage(playerid, Green, "Da imate firmu, primili biste payday!");
#if TIMEDEBUG == 1
printf("Time taken to execute Payday(): %i", GetTickCount()-tick);
#endif
return 1;
}
stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
stock rand(minnum = cellmin,maxnum = cellmax) return random(maxnum - minnum + 1) + minnum; //swtiches so much better
ubacim ovo
if(BizzInfo[houseid][bSetted] == 0)
{
new string2[256];
new Kucajtee;
format(string, sizeof(string),"server uklonjen!RP/Bizzes/%d.ini",houseid);
dini_Create(string);
if(sscanf(params, "i", Kucajtee))
{
SCM(playerid, COLOR_GRAD2, "Koriscenje: /setbizz [kucajte]");
SCM(playerid, COLOR_GRAD2, "Kucajte: 0 (Cluckin Bell) - 1 (Burger Shoot) - 2 (Pizza Stack) - 3 (Donut Shop) - 4 (24-7) - 5 (Strip Club) - 6 (Bar) - 7 (Gym)");
SCM(playerid, COLOR_GRAD2, "Kucajte: 8 (Sex Shop) - 9 (Binco) - 10 (Ammunation) - 11 (Disco) - 12 (Restaurant) - 13 (ZIP) - 14(Victom) - 15 (Sub Urban) - 16 (Trafika) - 17 (Prodavnica Mobilni Telefona)");
return 1;
}
if(Kucajtee == 0) // Cluckin
{
BizzInfo[houseid][bExitX] = 365.server uklonjen!96;
BizzInfo[houseid][bExitY] = -9.169898;
BizzInfo[houseid][bExitZ] = 1001.851623;
BizzInfo[houseid][bBuyPrice] = 325000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 9;
BizzInfo[houseid][bInteriorNr] = 20;
strmid(BizzInfo[houseid][bMessage],"Cluckin' Bell",0,strlen("Cluckin' Bell"),255);
}
else if(Kucajtee == 1) // Burger
{
BizzInfo[houseid][bExitX] = 363.217712;
BizzInfo[houseid][bExitY] = -74.911697;
BizzInfo[houseid][bExitZ] = 1001.507812;
BizzInfo[houseid][bBuyPrice] = 325000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 10;
BizzInfo[houseid][bInteriorNr] = 21;
strmid(BizzInfo[houseid][bMessage],"Burger Shoot",0,strlen("Burger Shoot"),255);
}
else if(Kucajtee == 2) // Pizza
{
BizzInfo[houseid][bExitX] = 372.411712;
BizzInfo[houseid][bExitY] = -130.457702;
BizzInfo[houseid][bExitZ] = 1001.492187;
BizzInfo[houseid][bBuyPrice] = 325000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 5;
BizzInfo[houseid][bInteriorNr] = 22;
strmid(BizzInfo[houseid][bMessage],"Pizza Shop",0,strlen("Pizza Shop"),255);
}
else if(Kucajtee == 3) // Donut
{
BizzInfo[houseid][bExitX] = 377.172393;
BizzInfo[houseid][bExitY] = -193.304504;
BizzInfo[houseid][bExitZ] = 1000.632812;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 17;
BizzInfo[houseid][bInteriorNr] = 30;
strmid(BizzInfo[houseid][bMessage],"Donut Shop",0,strlen("Donut Shop"),255);
}
else if(Kucajtee == 4) // 24-7
{
if(nextshop == 1)
{
BizzInfo[houseid][bExitX] = -25.132600;
BizzInfo[houseid][bExitY] = -139.067001;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 16;
nextshop ++;
}
else if(nextshop == 2)
{
BizzInfo[houseid][bExitX] = -28.261899;
BizzInfo[houseid][bExitY] = -31.767400;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 4;
nextshop ++;
}
else if(nextshop == 3)
{
BizzInfo[houseid][bExitX] = -27.391899;
BizzInfo[houseid][bExitY] = -58.252899;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 6;
nextshop ++;
}
else if(nextshop == 4)
{
BizzInfo[houseid][bExitX] = -30.929899;
BizzInfo[houseid][bExitY] = -92.011398;
BizzInfo[houseid][bExitZ] = 1003.546875;
BizzInfo[houseid][bInterior] = 18;
nextshop = 1;
}
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 5;
BizzInfo[houseid][bInteriorNr] = 12;
strmid(BizzInfo[houseid][bMessage],"24-7",0,strlen("24-7"),255);
}
else if(Kucajtee == 5) // Pig Pen
{
BizzInfo[houseid][bExitX] = 1204.846191;
BizzInfo[houseid][bExitY] = -13.852100;
BizzInfo[houseid][bExitZ] = 1000.921875;
BizzInfo[houseid][bBuyPrice] = 385000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 2;
BizzInfo[houseid][bInteriorNr] = 17;
strmid(BizzInfo[houseid][bMessage],"Strip Club",0,strlen("Strip Club"),255);
}
else if(Kucajtee == 6) // Bar
{
BizzInfo[houseid][bExitX] = 501.870788;
BizzInfo[houseid][bExitY] = -67.582000;
BizzInfo[houseid][bExitZ] = 998.757812;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 11;
BizzInfo[houseid][bInteriorNr] = 26;
strmid(BizzInfo[houseid][bMessage],"Bar",0,strlen("Bar"),255);
}
else if(Kucajtee == 7) // Gym
{
BizzInfo[houseid][bExitX] = 772.359375;
BizzInfo[houseid][bExitY] = -5.515697;
BizzInfo[houseid][bExitZ] = 1000.728576;
BizzInfo[houseid][bBuyPrice] = 400000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 5;
BizzInfo[houseid][bInteriorNr] = 15;
strmid(BizzInfo[houseid][bMessage],"Gym",0,strlen("Gym"),255);
}
else if(Kucajtee == 8) // Sex Shop
{
BizzInfo[houseid][bExitX] = -100.295700;
BizzInfo[houseid][bExitY] = -24.654399;
BizzInfo[houseid][bExitZ] = 1000.718811;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 5;
BizzInfo[houseid][bInterior] = 3;
BizzInfo[houseid][bInteriorNr] = 34;
strmid(BizzInfo[houseid][bMessage],"Sex Shop",0,strlen("Sex Shop"),255);
}
else if(Kucajtee == 9) // Binco
{
BizzInfo[houseid][bExitX] = 207.766204;
BizzInfo[houseid][bExitY] = -111.266296;
BizzInfo[houseid][bExitZ] = 1005.132812;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 15;
BizzInfo[houseid][bInteriorNr] = 16;
strmid(BizzInfo[houseid][bMessage],"Binco",0,strlen("Binco"),255);
}
else if(Kucajtee == 10) // Ammunation
{
BizzInfo[houseid][bExitX] = 315.762786;
BizzInfo[houseid][bExitY] = -143.661193;
BizzInfo[houseid][bExitZ] = 999.601623;
BizzInfo[houseid][bBuyPrice] = 750000;
BizzInfo[houseid][bLevelNeeded] = 10;
BizzInfo[houseid][bInterior] = 7;
BizzInfo[houseid][bInteriorNr] = 14;
strmid(BizzInfo[houseid][bMessage],"Ammunation",0,strlen("Ammunation"),255);
}
else if(Kucajtee == 11) // Disco
{
BizzInfo[houseid][bExitX] = 493.439300;
BizzInfo[houseid][bExitY] = -24.916900;
BizzInfo[houseid][bExitZ] = 1000.671875;
BizzInfo[houseid][bBuyPrice] = 350000;
BizzInfo[houseid][bLevelNeeded] = 6;
BizzInfo[houseid][bInterior] = 17;
BizzInfo[houseid][bInteriorNr] = 18;
strmid(BizzInfo[houseid][bMessage],"Disco",0,strlen("Disco"),255);
}
else if(Kucajtee == 12) // Restaurant
{
BizzInfo[houseid][bExitX] = 460.265411;
BizzInfo[houseid][bExitY] = -88.611503;
BizzInfo[houseid][bExitZ] = 999.554687;
BizzInfo[houseid][bBuyPrice] = 300000;
BizzInfo[houseid][bLevelNeeded] = 5;
BizzInfo[houseid][bInterior] = 4;
BizzInfo[houseid][bInteriorNr] = 38;
strmid(BizzInfo[houseid][bMessage],"Restaurant",0,strlen("Restaurant"),255);
}
else if(Kucajtee == 13) // ZIP
{
BizzInfo[houseid][bExitX] = 161.410293;
BizzInfo[houseid][bExitY] = -96.687202;
BizzInfo[houseid][bExitZ] = 1001.804687;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 18;
BizzInfo[houseid][bInteriorNr] = 36;
strmid(BizzInfo[houseid][bMessage],"ZIP",0,strlen("ZIP"),255);
}
else if(Kucajtee == 14) // Victim
{
BizzInfo[houseid][bExitX] = 227.342803;
BizzInfo[houseid][bExitY] = -8.243800;
BizzInfo[houseid][bExitZ] = 1002.210876;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 5;
BizzInfo[houseid][bInteriorNr] = 37;
strmid(BizzInfo[houseid][bMessage],"Victim",0,strlen("Victim"),255);
}
else if(Kucajtee == 15) // Suburban
{
BizzInfo[houseid][bExitX] = 203.895294;
BizzInfo[houseid][bExitY] = -50.656700;
BizzInfo[houseid][bExitZ] = 1001.804687;
BizzInfo[houseid][bBuyPrice] = 600000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 1;
BizzInfo[houseid][bInteriorNr] = 35;
strmid(BizzInfo[houseid][bMessage],"Sub urban",0,strlen("Sub urban"),255);
}
else if(Kucajtee == 16) // Trafika
{
BizzInfo[houseid][bExitX] = 203.895294;
BizzInfo[houseid][bExitY] = -50.656700;
BizzInfo[houseid][bExitZ] = 1001.804687;
BizzInfo[houseid][bBuyPrice] = 45000;
BizzInfo[houseid][bLevelNeeded] = 4;
BizzInfo[houseid][bInterior] = 0;
BizzInfo[houseid][bInteriorNr] = 35;
BizzInfo[houseid][bTrafika] = 1;
strmid(BizzInfo[houseid][bMessage],"Trafika",0,strlen("Trafika"),255);
}
else if(Kucajtee == 17) // Prodavnica mobilnih
{
BizzInfo[houseid][bExitX] = 1554.3765;
BizzInfo[houseid][bExitY] = 101.8853;
BizzInfo[houseid][bExitZ] = 977.2898;
BizzInfo[houseid][bBuyPrice] = 200000;
BizzInfo[houseid][bLevelNeeded] = 8;
BizzInfo[houseid][bInterior] = 0;
BizzInfo[houseid][bInteriorNr] = 0;
BizzInfo[houseid][bMobilni] = 1;
strmid(BizzInfo[houseid][bMessage],"Prodavnica Mobilnih Telefona",0,strlen("Prodavnica Mobilnih Telefona"),255);
}
Uradi te mi samo jedan primjer pa cu ja sam dalje molim vas
?
Kad nece niko da mi pomogne moze LOCK!
Aj da pomognem ali moras mi reci
// Ova komanda sluzi za pravljenje Business
COMMAND:stvorifirmu(playerid, params[])
{
new busid,cost,name[128];
new Float:x,Float:y,id;
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"I(500000)S(Na prodaju)[128]i",cost,name,id))return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /stvorifirmu [cjena] [ime frime] [Interior 1-(Cluckin Bell) | 2-]");
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),"Frime/%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, "OwnedBus",0);
dini_IntSet(file, "HasOwner",0);
if(id == 1)
{
dini_FloatSet(file, "KoordinateX_UBizu", x_koo);//Stavis kako treba da ti bude koordinate u biznisu gde je taj int i kako ide promenljiva
dini_FloatSet(file, "KoordinateY_UBizu", y_koo);//Isto ko gore
dini_FloatSet(file, "KoordinateZ_UBizu", z_koo);//Isto ko gore
dini_IntSet(file, "World",busid+1);//Stavio sam taj VW jer je tako mnogo bolje da se st avlja VW
dini_IntSet(file, "Interior",INTID);//Ide int id
}
BusinessInfo[busid][CP] = CreateDynamicCP(X,Y,Z,1.0,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid),-1,50.0);
format(Label, sizeof(Label), "{ccccff}%s\n{999999}Nema vlasnika\n{00BC00}Cjena: {999999}$%i\nID: %i", name,cost,busid);
BusinessInfo[busid][bLabel] = Create3DTextLabel(Label,White,X,Y,Z,100.0,GetPlayerVirtualWorld(playerid),1);
format(String,sizeof(String),"Firma stvorena. Ime: %s | Cjena: $%i | Vlasnik: Nema vlasnika | ID: %i",name,cost,busid);
SendClientMessage(playerid,Green,String);
return 1;
}
Napisao sam ti primer...
E hvala brate,napravio sam,pa kad dodjem iz skole probacu da vidim radi li, pa javljam sta i kako :D