Jump to content
  • 0

Problema /buy


MrBl00d

Question

Am bagat la /buy ,o noua optiune ,numita makemolotov ,dar imi da aceasta eroare

[pawn]D:\Script-uri\SA-MP\eMAV RolepLay\gamemodes\NVL.pwn(18703) : error 017: undefined symbol "item"[/pawn]

Dar si la celelalte optiuni de cumparare de la /buy foloseste item ... nu stiu de ce la alea nu da eror la item si la asta da ...

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

[pawn]else if (item == 17 && GetPlayerMoney(playerid) > 5000)

{

    if(PlayerInfo[playerid][pTraderPerk] > 0)

    {

new skill = 50000 / 10;

new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);

new payout = 50000 - price;

GivePlayerMoney(playerid, - payout);

format(string, sizeof(string), "~r~-$%d", payout);

GameTextForPlayer(playerid, string, 5000, 1);

}

else

{

    GivePlayerMoney(playerid, - 50000);

format(string, sizeof(string), "~r~-$%d", 50000);

GameTextForPlayer(playerid, string, 5000, 1);

}

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "Molotov Maker purchased.");

SendClientMessage(playerid, COLOR_GRAD4, string);

SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now use /makemolotov to create a molotov.");

MolotovMaked[playerid] = 1;

return 1;

}[/pawn]

Acesta este tot script-ul ,eroare da de la prima linie [pawn]else if (item == 17 && GetPlayerMoney(playerid) > 5000)[/pawn] ,aratati-mi voi unde tre sa-l pun new item; sa-l definesc

Link to comment
Share on other sites

Adica asa ?

[pawn]else if (item == 17 && GetPlayerMoney(playerid) > 5000)

{

                                              new item;

    if(PlayerInfo[playerid][pTraderPerk] > 0)

    {

new skill = 50000 / 10;

new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);

new payout = 50000 - price;

GivePlayerMoney(playerid, - payout);

format(string, sizeof(string), "~r~-$%d", payout);

GameTextForPlayer(playerid, string, 5000, 1);

}

else

{

    GivePlayerMoney(playerid, - 50000);

format(string, sizeof(string), "~r~-$%d", 50000);

GameTextForPlayer(playerid, string, 5000, 1);

}

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "Molotov Maker purchased.");

SendClientMessage(playerid, COLOR_GRAD4, string);

SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now use /makemolotov to create a molotov.");

MolotovMaked[playerid] = 1;

return 1;

}[/pawn]

Link to comment
Share on other sites

Nu , banuiesc ca inainte de

else if (item == 17 && GetPlayerMoney(playerid) > 5000)
Ai si un:
if( bla bla bla )
{
.........
}

si pui inainte de if , nu de else if , adica primul if de la comanda / callback sau ce ai acolo... de unde incepe if , pe urma else if . Nu stiu daca m-am exprimat bine astfel incat sa intelegi.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.