SA-MP Forums Archive
Need Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Help! (/showthread.php?tid=513974)



Need Help! - audyantgtr - 19.05.2014

Код:
C:\Users\User\Desktop\samp project\gamemodes\tes.pwn(40488) : error 017: undefined symbol "idx"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Error.
PHP код:
else if(!strcmp(params"price"true5))
    {
        if(
sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit price [bizid] [price]");
        if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
        if(
strcmp("Tidak ada"BizInfo[bizid][bOwner])) return SendClientMessage(playeridCOLOR_GREY"You can't edit the price of owned businesses.");
        
BizInfo[bizid][bPrice] = input;
        
format(stringsizeof(string), "ID: %d\n%s\n%s\nOwner: %s\nStatus: For Sale\nPrice: $%d"idxRBT(idx), BizInfo[idx][bMessage], BizInfo[idx][bOwner], BizInfo[bizid][bPrice]);
        
UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITEstring);
        
format(stringsizeof(string), "AdmWarn: %s has set business ID %d's price to $%d."GetPlayerNameEx(playerid), bizidinput);
        
ABroadCast(COLOR_YELLOWstring4);
        
Log("logs/business.log"string);
    } 



Re: Need Help! - JFF - 19.05.2014

You need to define the idx

add this under the includes

pawn Код:
new idx;



Re: Need Help! - Rittik - 19.05.2014

pawn Код:
else if(!strcmp(params, "price", true, 5))
    {
        if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit price [bizid] [price]");
        if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
        if(strcmp("Tidak ada", BizInfo[bizid][bOwner])) return SendClientMessage(playerid, COLOR_GREY, "You can't edit the price of owned businesses.");
        new idx;//here you go.
        BizInfo[bizid][bPrice] = input;
        format(string, sizeof(string), "ID: %d\n%s\n%s\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, RBT(idx), BizInfo[idx][bMessage], BizInfo[idx][bOwner], BizInfo[bizid][bPrice]);
        UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITE, string);
        format(string, sizeof(string), "AdmWarn: %s has set business ID %d's price to $%d.", GetPlayerNameEx(playerid), bizid, input);
        ABroadCast(COLOR_YELLOW, string, 4);
        Log("logs/business.log", string);
    }