Jump to content

[Problema] Script /createbizz


Recommended Posts

Salut!
In primul rand, as vrea sa mentionez ca sunt foarte, dar foarte nou in scripting, sunt un jucator de samp care s-a gandit ca i-ar placea tare mult sa isi deschida un server de samp.

Sper sa fi-ti rabdatori si sa ma puteti ajuta cu aceasta problema :)

Sa v-a explic, am luat un GM de pe internet, dar el nu are comanda /createbizz, si am incercat sa adaug eu comanda deja facuta, de la un scripter pe nume Edison. (Stiu... nu ma judecati, am copiat cuvant cu cuvant, ce era acolo)

Scriptul ar fi acesta 

Quote

// createbusiness
function BizWithType(type) {
    for(new i = 1; i < sizeof(BizzInfo); i++) {
        if(BizzInfo[i][bType] == type) return i;
    }
    return 0;
}

CMD:createbiz(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 6) return 1;
    new type, value, level, idd = bussines+1, Float: Pos[3], query[512];
    if(sscanf(params, "iii", type, value, level)) {
        SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/createbiz <type> <value> <level>");
        SCM(playerid, -1, "Types: Banca (1), Gun Shop (2), Club (3), Restaurant (4), Sex shop (5), 24/7 (6), Binco (7), Burger (8), Casino (9)");
        SCM(playerid, -1, "CNN (10), Gas Station (17), PNS (19), Pizza (21)");
        return 1;
    }
    if(type > 10 && type < 17 || type == 20 || type > 21 || type < 1) return SCM(playerid, COLOR_GREY, "Invalid type!");
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);

    new biz = BizWithType(type);
    // daca e benzinarie
    format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`, `Static`) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d')",
    Pos[0], Pos[1], Pos[2], BizzInfo[biz][bExitX], BizzInfo[biz][bExitY], BizzInfo[biz][bExitZ], level, value, type, BizzInfo[biz][bInterior], BizzInfo[biz][bStatic]);
    mysql_tquery(SQL, query, "", "");
    format(query, sizeof(query), "UPDATE `bizz` SET `Virtual`='%d' WHERE `ID`='%d'", idd, idd);
    mysql_tquery(SQL, query, "", "");

    new i = idd;
    if(type == 17) {
        format(query, sizeof(query), "UPDATE `bizz` SET `Gas`='%d' WHERE `ID`='%d'", 1, idd);
        mysql_tquery(SQL, query, "", "");
        BizzInfo[i][bGas] = 1;
    }
    BizzInfo[idd][bExitX] = BizzInfo[biz][bExitX]; BizzInfo[idd][bExitY] = BizzInfo[biz][bExitY]; BizzInfo[idd][bExitZ] = BizzInfo[biz][bExitZ];
    BizzInfo[idd][bEntranceX] = Pos[0];
    BizzInfo[idd][bEntranceY] = Pos[1];
    BizzInfo[idd][bEntranceZ] = Pos[2];
    BizzInfo[idd][bBuyPrice] = value;
    BizzInfo[idd][bLevel] = level;
    BizzInfo[idd][bVirtual] = idd;
    BizzInfo[idd][bType] = type;
    BizzInfo[idd][bInterior] = BizzInfo[biz][bInterior];
    BizzInfo[idd][bStatic] = BizzInfo[biz][bStatic];

    BizzInfo[i][bPickup] = CreateDynamicPickup(1239, 23, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
    switch(BizzInfo[i][bType]) {
        case 1: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],52,0,-1,0,-1,500.0); // banca
        case 2: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],6,0,-1,0,-1,500.0); // gun shop
        case 3: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],49,0,-1,0,-1,500.0); // club
        case 4: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],50,0,-1,0,-1,500.0); // restaurant
        case 5: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],38,0,-1,0,-1,500.0); // sexshop
        case 6: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],17,0,-1,0,-1,500.0); // 24/7
        case 7: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],45,0,-1,0,-1,500.0); // binco
        case 8: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],10,0,-1,0,-1,500.0); // burger
        case 9: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],25,0,-1,0,-1,500.0); // casino
        case 10: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,-1,0,-1,500.0); // cnn
        //case 11: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,-1,0,-1,500.0); // moto
        case 12: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],55,0,-1,0,-1,500.0); // car
        case 13: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,-1,0,-1,500.0); // cs
        //case 14: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,-1,0,-1,500.0); // furniture
        case 15: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,-1,0,-1,500.0); // car color
        case 16: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,-1,0,-1,500.0); // paint
        case 17: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],51,0,-1,0,-1,500.0); // gas station
        case 18: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],53,0,-1,0,-1,500.0); // race
        case 19: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,-1,0,-1,500.0); // pns
        case 20: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],9,0,-1,0,-1,500.0); // pescarie
        case 21: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,-1,0,-1,500.0); // pizza
        case 27: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,-1,0,-1,500.0); // tuning
    }
    UpdateLabel(2,idd);
    bussines++;
    return 1;
}

Mai jos, aveti erorile care imi apar in momentul in care, compilez GM-ul

Quote

 (9609) : error 010: invalid function or declaration
(9610) : error 010: invalid function or declaration
(9611) : error 010: invalid function or declaration
(9613) : error 010: invalid function or declaration
(9628) : error 017: undefined symbol "BizWithType"
(9630 -- 9631) : error 017: undefined symbol "bStatic"
(9640) : error 017: undefined symbol "bGas"
(9647) : error 017: undefined symbol "bLevel"
(9649) : error 017: undefined symbol "bType"
(9651) : error 017: undefined symbol "bStatic"
(9653) : error 017: undefined symbol "bPickup"
(9654) : error 017: undefined symbol "bType"
(9678) : error 017: undefined symbol "UpdateLabel"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

Ce pot sa spun e ca, am mai cautat pe internet erori de genul, si unii spuneau ca trebuie sa definesc bGas, bLevel, etc.

Asta... am si facut. Insa, rezultatul a fost unul diferit fata de prima compilare.

La fel si erorile... 

Am sa va las mai jos, erorile din a doua compilare, dupa ce am definit toate acele lucruri.

Quote

(357) : error 031: unknown directive
(9616) : error 010: invalid function or declaration
(9617) : error 010: invalid function or declaration
(9618) : error 010: invalid function or declaration
(9620) : error 010: invalid function or declaration
(9635) : error 017: undefined symbol "BizWithType"
(9637 -- 9638) : error 017: undefined symbol "bStatic"
(9647) : error 017: undefined symbol "bGas"
(9654) : error 017: undefined symbol "bLevel"
(9656) : error 017: undefined symbol "bType"
(9658) : error 017: undefined symbol "bStatic"
(9660) : error 017: undefined symbol "bPickup"
(9661) : error 017: undefined symbol "bType"
(9685) : error 017: undefined symbol "UpdateLabel"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


14 Errors.
 

 

Am sa va las mai jos, acele linii cu erori.

357 -    #bGas

function BizWithType(type) {
    for(new i = 1; i < sizeof(BizzInfo); i++) {
        if(BizzInfo[i][bType] == type) return i;
    }
    return 0;
}

CMD:createbiz(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 6) return 1;
    new type, value, level, idd = bussines+1, Float: Pos[3], query[512];
    if(sscanf(params, "iii", type, value, level)) {
        SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/createbiz <type> <value> <level>");
        SCM(playerid, -1, "Types: Banca (1), Gun Shop (2), Club (3), Restaurant (4), Sex shop (5), 24/7 (6), Binco (7), Burger (8), Casino (9)");
        SCM(playerid, -1, "CNN (10), Gas Station (17), PNS (19), Pizza (21)");
        return 1;
    }
    if(type > 10 && type < 17 || type == 20 || type > 21 || type < 1) return SCM(playerid, COLOR_GREY, "Invalid type!");
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);

    new biz = BizWithType(type);
    // daca e benzinarie
    format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`, `Static`) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d')",
    Pos[0], Pos[1], Pos[2], BizzInfo[biz][bExitX], BizzInfo[biz][bExitY], BizzInfo[biz][bExitZ], level, value, type, BizzInfo[biz][bInterior], BizzInfo[biz][bStatic]);
    mysql_tquery(SQL, query, "", "");
    format(query, sizeof(query), "UPDATE `bizz` SET `Virtual`='%d' WHERE `ID`='%d'", idd, idd);
    mysql_tquery(SQL, query, "", "");

    new i = idd;
    if(type == 17) {
        format(query, sizeof(query), "UPDATE `bizz` SET `Gas`='%d' WHERE `ID`='%d'", 1, idd);
        mysql_tquery(SQL, query, "", "");
        BizzInfo[i][bGas] = 1;
    }
    BizzInfo[idd][bExitX] = BizzInfo[biz][bExitX]; BizzInfo[idd][bExitY] = BizzInfo[biz][bExitY]; BizzInfo[idd][bExitZ] = BizzInfo[biz][bExitZ];
    BizzInfo[idd][bEntranceX] = Pos[0];
    BizzInfo[idd][bEntranceY] = Pos[1];
    BizzInfo[idd][bEntranceZ] = Pos[2];
    BizzInfo[idd][bBuyPrice] = value;
    BizzInfo[idd][bLevel] = level;
    BizzInfo[idd][bVirtual] = idd;
    BizzInfo[idd][bType] = type;
    BizzInfo[idd][bInterior] = BizzInfo[biz][bInterior];
    BizzInfo[idd][bStatic] = BizzInfo[biz][bStatic];

    BizzInfo[i][bPickup] = CreateDynamicPickup(1239, 23, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
    switch(BizzInfo[i][bType]) {
        case 1: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],52,0,-1,0,-1,500.0); // banca
        case 2: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],6,0,-1,0,-1,500.0); // gun shop
        case 3: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],49,0,-1,0,-1,500.0); // club
        case 4: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],50,0,-1,0,-1,500.0); // restaurant
        case 5: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],38,0,-1,0,-1,500.0); // sexshop
        case 6: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],17,0,-1,0,-1,500.0); // 24/7
        case 7: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],45,0,-1,0,-1,500.0); // binco
        case 8: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],10,0,-1,0,-1,500.0); // burger
        case 9: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],25,0,-1,0,-1,500.0); // casino
        case 10: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,-1,0,-1,500.0); // cnn
        //case 11: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,-1,0,-1,500.0); // moto
        case 12: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],55,0,-1,0,-1,500.0); // car
        case 13: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,-1,0,-1,500.0); // cs
        //case 14: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,-1,0,-1,500.0); // furniture
        case 15: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,-1,0,-1,500.0); // car color
        case 16: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,-1,0,-1,500.0); // paint
        case 17: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],51,0,-1,0,-1,500.0); // gas station
        case 18: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],53,0,-1,0,-1,500.0); // race
        case 19: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,-1,0,-1,500.0); // pns
        case 20: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],9,0,-1,0,-1,500.0); // pescarie
        case 21: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,-1,0,-1,500.0); // pizza
        case 27: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,-1,0,-1,500.0); // tuning
    }
    UpdateLabel(2,idd);
    bussines++;
    return 1;
}

Sper ca ma puteti ajuta, v-as fi foarte recunoscator!

Sper sa pot si sa inteleg si sa ma descurc, pe baza explicatiilor voastre. 

Multumesc!

Link to post
Share on other sites

Nu iti gaseste variabilele 
error 017: undefined symbol "bStatic"
(9647) : error 017: undefined symbol "bGas"
(9654) : error 017: undefined symbol "bLevel"
(9656) : error 017: undefined symbol "bType"
(9658) : error 017: undefined symbol "bStatic"
(9660) : error 017: undefined symbol "bPickup"
(9661) : error 017: undefined symbol "bType"
(9685) : error 017: undefined symbol "UpdateLabel"

 

 

Cand eram mic, eram mare zdreanta Eu fut*am femei, vara miu umbla prin casa

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.aacf6e45f3894429f134b2e37f997f6f.gif

Discord: ㍿ Luca лол㍿ツ#5482

Sunt de moda veche inca mai cred in Respect!

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.bcf86dadd9b43351554dd738f470725f.gif

 

Link to post
Share on other sites

sa inlocuiesti cu variabilele tale

 

 

 

Cand eram mic, eram mare zdreanta Eu fut*am femei, vara miu umbla prin casa

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.aacf6e45f3894429f134b2e37f997f6f.gif

Discord: ㍿ Luca лол㍿ツ#5482

Sunt de moda veche inca mai cred in Respect!

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.bcf86dadd9b43351554dd738f470725f.gif

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.