21.05.2011, 04:13
Код:
PlayerHaul[108][pCapasity] = 100; PlayerHaul[109][pCapasity] = 100; PlayerHaul[110][pCapasity] = 50; PlayerHaul[111][pCapasity] = 50;
Код:
PlayerHaul[435][pCapasity] = 100; PlayerHaul[591][pCapasity] = 50;
Then I Need It To Check If The Trailer Is Attached To The Truck Model Id 515
At The Moment It Doesn't Even Have Working Trailers
If you Get In The Truck It Vehicle Id 108 It Says You Have Products 0/100
And That's Without Trailer On
But The Script Has Been Edited So Now It Checks For The Trailer If There's No Trailer
It Wont Let You Buy Any Products
Код:
if(strcmp(cmd, "/buyprods", true) == 0) { if(IsPlayerConnected(playerid)) { new tmpcar = GetPlayerVehicleID(playerid); new compcost = 20; if(IsPlayerInRangeOfPoint(playerid, 5, -45.69187,-224.1864,6.515688)) { if(IsATruck(tmpcar) && IsTrailerAttachedToVehicle(tmpcar)) //Modded { 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); GivePlayerCash(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 have a trailer to deliver Products."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You are not in trucker place."); return 1; } } return 1; }
And The Truck Part There It Checks The Vehicle
Код:
if(IsATruck(newcar)) { if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17) { format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SendClientMessage(playerid, COLOR_WHITE, "INFO: You can deliver Products to Businesses."); SendClientMessage(playerid, COLOR_WHITE, "INFO: Commands are /loadfood"); } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle."); } }
Код:
if(IsATruck(newcar)) { if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17) { format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SendClientMessage(playerid, COLOR_WHITE, "INFO: You can deliver Products to Businesses."); SendClientMessage(playerid, COLOR_WHITE, "INFO: Commands are /loadfood"); } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle."); } }
Can Some One Please Help