- 0
problema /buyprods
-
Similar Content
-
- 2 answers
- 816 views
-
Problema turf
By Soryn.,
- 3 answers
- 442 views
-
- 0 replies
- 184 views
-
- 2 replies
- 348 views
-
- 1 reply
- 84 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
crazyzee
Salut ALL , De cand am adaugat niste masini pe server nu mai functioneaza comanda /buyprods , am aflat idurile la masinile de la trucker insa nu stiu unde trebuie sa le pun .
Cand ma urc in masina si scriu /buyprods imi apare mesaju : Products: 0/0.
Comanda /buyprods :
[pawn]if(strcmp(cmd, "/buyprods", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 50;
if(PlayerToPoint(60.0, playerid, 2787.8,-2436.3,13.7) || PlayerToPoint(60.0, playerid, -1705.7233,14.0890,3.5547))
{
if(IsATruck(tmpcar))
{
if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
{
new amount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /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);
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;
}
}
}
return 1;
}[/pawn]
RPG.VIBEPLAY.RO
Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
Link to comment
Share on other sites
1 answer to this question
Recommended Posts