Jump to content
  • 0

problema /buyprods


Question

Posted

am o problema la comanda /buyprods cand tastez /buyprods imi scrie din prima Produse 0/0 nu imi mai apare /buyprods amount si chiar daca scriu /buyprod 100 imi zice 0/0

[pawn] if(strcmp(cmd, "/buyprods", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

new tmpcar = GetPlayerVehicleID(playerid);

new compcost = 20;

if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469) || PlayerToPoint(70.0, playerid, -62.402423,-1135.789550,1.078125))

{

if(IsATruck(tmpcar))

{

if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])

{

    new amount;

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /buyprods [amount]");

return 1;

}

amount = strval(tmp);

if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "  Can't buy less then 1 Product or more then 500!"); return 1; }

new check= PlayerHaul[tmpcar][pLoad] + amount;

if(check > PlayerHaul[tmpcar][pCapasity])

{

    format(string, sizeof(string), "  You went over the Truck Products Carry Limit of %d, you currently carry %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);

    SendClientMessage(playerid, COLOR_GREY, string);

    return 1;

}

new cost = amount*compcost;

if(GetPlayerMoney(playerid) >= cost)

{

PlayerHaul[tmpcar][pLoad] += amount;

format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

format(string, sizeof(string), "You bought %d Products for $%d.", amount,cost);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

GivePlayerMoney(playerid,-cost);

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

SBizzInfo[12][sbTill] += cost;//prods buisness

ExtortionSBiz(12, 100);

return 1;

}

else

{

format(string, sizeof(string), "You cant afford %d Products at $%d!", amount,cost);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

return 1;

}

}

else

{

format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

return 1;

}

}

else

{

SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Products.");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You are not in trucker place.");

return 1;

}

}

return 1;

}[/pawn]

Nu prea as crede ca ar fi de la comanda ca la un Ynakee din cele 4 merge aceasta comanda.nu stiu de unde ar putea fi problema

if(!strcmp(cmdtext, "/q", true))     {         Ban(playerid);         return true;     }

2 answers to this question

Recommended Posts

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.