- 0
Va rog ajutatima /buyprods
-
Similar Content
-
Cum Adau un Anticheat pe serverul de samp ? totul este facut perfect dar am observat ca sunt codati si nu stiu ce sa fac in aceasta privinta , va rog mult daca poate cineva sa ma ajute sa rezolv treaba asta ca am cautat vreo 2 zile peste tot internetul
By Decisivul,
- 0 replies
- 273 views
-
Salut,imi apare asta cand pornesc serverul,dar eu am bagat acolo in server.cfg ce e nevoie,imi puteti spune va rog problema ?
By leoo671,
- 0 replies
- 827 views
-
- 9 replies
- 756 views
-
- 3 replies
- 596 views
-
- 2 answers
- 429 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
susu
Am si eu o problema cand intru in truck imi scrie prods: 0/0
si daca dau /buyprods tot la fel imi arata 0/0! va rog ajutatima si pe mine
[pawn]if(IsATruck(newcar))
{
format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
SendClientMessage(playerid, TEAM_GroveStreet_COLOR, string);
SendClientMessage(playerid, COLOR_WHITE, "INFO: You can deliver Products to Businesses.");
SendClientMessage(playerid, COLOR_WHITE, "INFO: Commands are /load /buyprods /sellprods");
}
if(strcmp(cmd, "/buyprods", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 50;
if(PlayerToPoint(60.0, playerid, -78.9067,-1130.7458,0.6489))
{
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_GroveStreet_COLOR, string);
format(string, sizeof(string), "You bought %d Products for $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GroveStreet_COLOR, string);
GivePlayerMoney(playerid,-cost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "You cant afford %d Products at $%d !", amount,cost);
SendClientMessage(playerid, TEAM_GroveStreet_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GroveStreet_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GroveStreet_COLOR, "This Vehicle does not deliver Products.");
return 1;
}
}
}
return 1;
}[/pawn]
Puteti da TC
am rezolvat
3 answers to this question
Recommended Posts