Help on making the system dynamic
#1

Well, ATM in my server If i want to add a business I must type it in script and restart the server , but I don't want this. I want to create a business IG and I found a code , but idk why I get errors.

Код:
COMMAND:createbiz(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You aren't authorized to use this command!");//Checks if player is a RCON admin..Change this with your admin system.

    new price, level, id, int, world, string[128], Float:Xi, Float:Yi, Float:Zi, inti;//All the new defines we will need.
    if(sscanf(params, "dddfff", price, level, int, Xi, Yi, Zi)) return SendClientMessage(playerid, COLOR_GREY, "YCMD: /createbiz [price] [type] [interior] [X] [Y] [Z]");//d stands for integer, f stands for float.

    if(level < 0 || level > 4) return SendClientMessage(playerid, COLOR_GREY, "YCMD: Type cannot go below 0, or above 10.");//

    if(price < 1000000) return SendClientMessage(playerid, COLOR_GREY, "COMMAND: Price cannot go below $1.000.000.");// Check if the price is below 1000, if it is it will return a message saying it.

    for(new h = 1;h < sizeof(biz);h++)//Loops through all the businesses
    {
        if(biz[h][bizprice] == 0)//Checks if the price of a business is 0.
        {
            id = h;
            break;//It stops looping if it is.
        }
    }
    new Float:X,Float:Y,Float:Z;//More new defines.
    GetPlayerPos(playerid, X, Y, Z);//Gets your player position, and saves it into floats.
    int = GetPlayerInterior(playerid);//Gets your interior, and saves it into a integer.
    world = GetPlayerVirtualWorld(playerid);//Gets your Virtual World, and saves it into a integer
    biz[id][bizinterior] = inti;
    biz[id][bizexit_x] = Xi;
    biz[id][bizexit_y] = Yi;
    biz[id][bizexit_z] = Zi;

    biz[id][tmpowner] = 0;
    biz[id][bizprice] = price;
    biz[id][biztype] = level;
    biz[id][bizenter_x] = X;
    biz[id][bizenter_y] = Y;
    biz[id][bizenter_z] = Z;

    biz[id][bizinterior] =int;
    biz[id][vw] =world;

    format(string, sizeof(string), "None");
    strmid(biz[id][bizname], string, 0, strlen(string), 255);
    new file4[40];
    format(file4, sizeof(file4), BPATH, id);
    new INI:File = INI_Open(file4);
    INI_SetTag(File,"data");
    INI_WriteInt(File,"tmpowner", biz[id][tmpowner]);
    INI_WriteInt(File,"bizprice", biz[id][bizprice]);
    INI_WriteString(File,"tmpowner", biz[id][tmpowner]);
    INI_WriteInt(File,"biztype", biz[id][biztype]);
    INI_WriteFloat(File,"bizenter_x", biz[id][bizenter_x]);
    INI_WriteFloat(File,"bizenter_y", biz[id][bizenter_y]);
    INI_WriteFloat(File,"bizenter_z", biz[id][bizenter_z]);
    INI_WriteFloat(File,"bizexit_x", biz[id][bizexit_x]);
    INI_WriteFloat(File,"bizexit_y", biz[id][bizexit_y]);
    INI_WriteFloat(File,"bizexit_z", biz[id][bizexit_z]);
    INI_WriteInt(File,"bizinterior", biz[id][bizinterior]);
    INI_WriteInt(File,"vw", biz[id][vw]);
    INI_WriteInt(File,"bInsideInt", biz[id][bInsideInt]);
    INI_WriteString(File,"bizname", biz[id][bizname]);
    INI_Close(File);
    return 1;
}
COMMAND:deletebiz(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 1; // Checks if a player is a RCON admin, again change this to your admin system.

    new id;

    if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "YCMD: /deletebiz [id]");
    if(biz[id][tmpowner] == 1) return SendClientMessage(playerid, COLOR_GREY, "This biz is owned.");//Checks if the biz is owned, if it is it won't allow it to be deleted.
        //Below it resets all the biz enum info.
    biz[id][tmpowner] = 0;
    biz[id][bizprice] = 0;
    biz[id][tmpowner] = 0;
    biz[id][biztype] = 0;
    biz[id][bizname] = 0;
    biz[id][bizenter_x] = 0;
    biz[id][bizenter_y] = 0;
    biz[id][bizenter_z] = 0;
    biz[id][bizexit_x] = 0;
    biz[id][bizexit_y] = 0;
    biz[id][bizexit_z] = 0;
    biz[id][bizinterior] = 0;
    biz[id][vw] = 0;

    new string[128];

    format(string, sizeof(string), biz, id);
    fremove(string);
    return 1;
}
The errors I get after dropping it in script
Код:
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17037) : error 033: array must be indexed (variable "bizprice")
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17053) : error 033: array must be indexed (variable "bizprice")
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17060) : warning 213: tag mismatch
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17065) : error 017: undefined symbol "BPATH"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17066) : error 017: undefined symbol "INI_Open"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17066) : warning 213: tag mismatch
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17067) : error 017: undefined symbol "INI_SetTag"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17068) : error 017: undefined symbol "INI_WriteInt"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17069) : error 017: undefined symbol "INI_WriteInt"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17070) : error 017: undefined symbol "INI_WriteString"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17071) : error 017: undefined symbol "INI_WriteInt"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17072) : error 017: undefined symbol "INI_WriteFloat"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17073) : error 017: undefined symbol "INI_WriteFloat"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17074) : error 017: undefined symbol "INI_WriteFloat"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17075) : error 017: undefined symbol "INI_WriteFloat"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17076) : error 017: undefined symbol "INI_WriteFloat"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17077) : error 017: undefined symbol "INI_WriteFloat"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17078) : error 017: undefined symbol "INI_WriteInt"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17079) : error 017: undefined symbol "INI_WriteInt"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17080) : error 017: undefined symbol "INI_WriteInt"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17081) : error 017: undefined symbol "INI_WriteString"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17082) : error 017: undefined symbol "INI_Close"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17066) : warning 204: symbol is assigned a value that is never used: "File"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17095) : error 033: array must be indexed (variable "bizprice")
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17106) : warning 213: tag mismatch
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(17110) : error 048: array dimensions do not match
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


22 Errors.
Код:
#include <a_samp>
#include <md5>
#include <dudb>
#include <irc>
#include <time>
#include <streamer>
#include <a_http>
#include <zcmd>
#include <dutils>
#include <Double-O-Files>
#include <a_zones>
Reply
#2

Код:
 #include < YSI\y_ini >
Reply
#3

Quote:

C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\pawno\include\YSI\y_hooks/impl.inc(2629) : warning 219: local variable "race" shadows a variable at a preceding level
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\pawno\include\YSI\y_hooks/impl.inc(2680) : warning 219: local variable "race" shadows a variable at a preceding level
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\pawno\include\YSI\y_hooks/impl.inc(272 : warning 219: local variable "race" shadows a variable at a preceding level
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\pawno\include\zcmd.inc(339) : error 025: function heading differs from prototype
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\pawno\include\zcmd.inc(340) : error 021: symbol already defined: "ReturnPlayerName"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(227) : warning 201: redefinition of constant/macro (symbol "File::%1(")
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(876) : error 021: symbol already defined: "FALSE"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

This is what I get if I add it
Reply
#4

I still need help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)