Hallo Liebe Community.
Ich hab mir Los Angeles Reallife 4.6 geholt.
Habe bei Trucker einen Bug endeckt.
Und zwar wenn man /buyprods [Zahl] eingibt dann kommt das gleiche wie bei /load
(Die stelle zum Produkte kaufen ist in der Nähe der Armybase.)
Hier der Code:
if(strcmp(cmd, "/load", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJob] != 11) { SendClientMessage(playerid, COLOR_GREY, " Du bist kein Trucker!"); return 1; } new tmpcar = GetPlayerVehicleID(playerid); new carid = GetVehicleModel(carid); if(!IsATruck(tmpcar)) { GameTextForPlayer(playerid, "~r~Du musst in einem Lieferwagen sein", 5000, 1); return 1; } format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); } return 1; } if(strcmp(cmd, "/buyprods", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJob] != 11) { SendClientMessage(playerid, COLOR_GREY, " Du bist kein Trucker!"); return 1; } new tmpcar = GetPlayerVehicleID(playerid); new compcost = 5; if(IsPlayerInRangeOfPoint(playerid,40.0, -1694.3030,32.3939,3.5547) || IsPlayerInRangeOfPoint(playerid,40.0, 2551.2012,-2228.6165,12.9152)) { if(IsATruck(tmpcar)) { if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity]) { new amount; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "/buyprods [Menge]"); return 1; } amount = strval(tmp); if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 500 sein !"); return 1; } new check= PlayerHaul[tmpcar][pLoad] + amount; if(check > PlayerHaul[tmpcar][pCapasity]) { format(string, sizeof(string), " Du hast das Limit mit %d Prods erreicht, Produkte: %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), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); format(string, sizeof(string), "Du hast %d Produkte für $%d gekauft.", 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), "Du kannst nicht %d Produkte für $%d anfordern!", amount,cost); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); return 1; } } else { format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); return 1; } } else { SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Produkte ausliefern."); return 1; } } else { SendClientMessage(playerid, COLOR_WHITE, "Du bist an keiner Material annahme Stelle!"); return 1; } } return 1; } if(strcmp(cmd, "/sellprods", true) == 0) { new cashmade; new tmpcar; if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJob] != 11) { SendClientMessage(playerid, COLOR_GREY, " Du bist kein Trucker!"); return 1; } tmpcar = GetPlayerVehicleID(playerid); if(!IsATruck(tmpcar)) { GameTextForPlayer(playerid, "~r~Du musst in einem Lieferwagen sein", 5000, 1); return 1; } if(PlayerHaul[tmpcar][pLoad] == 0) { GameTextForPlayer(playerid, "~r~Lieferwagen ist leer", 5000, 1); format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); return 1; } for(new i = 0; i < sizeof(BizzInfo); i++) { if (IsPlayerInRangeOfPoint(playerid,10.0,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ])) { //printf("Found House :%d",i); for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--) { if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts]) { GameTextForPlayer(playerid, "~r~Unser Geschaeft ist voll", 5000, 1); format(string, sizeof(string), "Einnahme $%d.", cashmade); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill]) { GameTextForPlayer(playerid, "~r~Deal nicht möglich", 5000, 1); format(string, sizeof(string), "Einnahme $%d.", cashmade); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } PlayerHaul[tmpcar][pLoad]--; BizzInfo[i][bProducts]++; cashmade = cashmade+BizzInfo[i][bPriceProd]; ConsumingMoney[playerid] = 1; GivePlayerMoney(playerid,BizzInfo[i][bPriceProd]); BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd]; if(PlayerHaul[tmpcar][pLoad] == 0) { GameTextForPlayer(playerid, "~r~Lieferwagen ist leer!", 5000, 1); format(string, sizeof(string), "Einnahme $%d.", cashmade); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } } OnPropUpdate(); return 1;
//Edit: Geändert