Code
CMD:load(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1563.4137,-1694.5535,5.8906))
{
if(GetVehicleModel(vehicleid) == 428)
{
new string[128], int;
if(sscanf(params, "i", int))return SendClientMessage(playerid, COLOR_GREY, "{247BA6}* Benutze {33AA33}/load [Menge]");
if(!(Spieler[playerid][pFraktion] == 14))return SendClientMessage(playerid, COLOR_RED, "Du bist kein Member der Transport GmbH.");
if(int < 1 || int > 50000)return SendClientMessage(playerid, COLOR_RED, "Du kannst nur maximal 50000 Produkte aufladen.");
new money = int*4;
if(GetMoney(playerid) < money)return SendClientMessage(playerid, COLOR_GREY, ERROR_MONEY);
if((int+Vehicle[vehicleid][vehProds]) > 50000)return SendClientMessage(playerid, COLOR_RED, "Du kannst nur maximal 50000 Materialien aufladen.");
Vehicle[vehicleid][vehProds] += int;
GiveMoney(playerid, -money);
SendClientMessage(playerid, COLOR_WHITE,"{21DD00}Ladung: Materialien");
format(string, sizeof(string), "{21DD00}Menge: %d/50000", Vehicle[vehicleid][vehProds], money);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if(IsPlayerInRangeOfPoint(playerid, 10.0, -14.7640,-277.4165,5.4297))
{
else if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514)
{
if(GetVehicleModel(GetVehicleTrailer(vehicleid)) == 435)
{
new string[128], int;
if(sscanf(params, "i", int))return SendClientMessage(playerid, COLOR_GREY, "{247BA6}* Benutze {33AA33}/load [Menge]");
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, COLOR_GREY, "** Du befindest dich in keinem Lieferwagen.");
if(!(Spieler[playerid][pFraktion] == 14))return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Member der Transport GmbH.");
if(int < 1 || int > 200)return SendClientMessage(playerid, COLOR_GREY, "** Du kannst nur maximal 200 Produkte aufladen.");
new money = int*40;
if(GetMoney(playerid) < money)return SendClientMessage(playerid, COLOR_GREY, ERROR_MONEY);
if((int+Vehicle[vehicleid][vehProds]) > 200)return SendClientMessage(playerid, COLOR_GREY, "** Du kannst nur maximal 200 Produkte aufladen.");
Vehicle[vehicleid][vehProds] += int;
GiveMoney(playerid, -money);
SendClientMessage(playerid, COLOR_WHITE,"{21DD00}Ladung: Produkte");
format(string, sizeof(string), "{21DD00}Menge: %d/200", Vehicle[vehicleid][vehProds]);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
printf("1");
if(IsPlayerInRangeOfPoint(playerid, 10.0, 264.9876,1392.1984,10.2901))
{
printf("2");
if(GetVehicleModel(GetVehicleTrailer(vehicleid)) == 584)
{
printf("3");
new string[128], int;
if(sscanf(params, "i", int))return SendClientMessage(playerid, COLOR_GREY, "{247BA6}* Benutze {33AA33}/load [Menge]");
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, COLOR_GREY, "** Du befindest dich in keinem Tanker.");
if(!(Spieler[playerid][pFraktion] == 14))return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Member der Transport GmbH.");
if(int < 1 || int > 2500)return SendClientMessage(playerid, COLOR_GREY, "** Du kannst nur maximal 2500 Liter aufladen.");
new money = int*15;
if(GetMoney(playerid) < money)return SendClientMessage(playerid, COLOR_GREY, ERROR_MONEY);
if((int+Vehicle[GetVehicleTrailer(vehicleid)][vehProds]) > 2500)return SendClientMessage(playerid, COLOR_GREY, "** Du kannst nur maximal 2500 Liter aufladen.");
Vehicle[GetVehicleTrailer(vehicleid)][vehProds] += int;
GiveMoney(playerid, -money);
SendClientMessage(playerid, COLOR_WHITE,"{21DD00}Ladung: Benzin");
format(string, sizeof(string), "{21DD00}Liter: %d/2500", Vehicle[GetVehicleTrailer(vehicleid)][vehProds]);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
printf("4");
return 1;
}
Alles anzeigen
Es klappt
Nur mehr mit laden dann haben wir es geschafft