Ich habe die autos von dem Fraktions autohaus verlegt aber nun kann ich kein auto mehr kaufen kann mir jemand sagen wo das problem liegt ?
forward FRAC_OnPlayerStateChange(playerid, newstate, oldstate);
public FRAC_OnPlayerStateChange(playerid, newstate, oldstate){
if(newstate==PLAYER_STATE_DRIVER){
new Carid1 = GetPlayerVehicleID(playerid);
for(new fbl;fbl<sizeof(FactionBuylist);fbl++){
if(Carid1 == FactionBuylist[fbl][fbCarid]){
if(IsAllowedFactionToBuy(GetPlayerLeader(playerid))){
TogglePlayerControllable(playerid,false);
new fblText[256];
format(fblText,sizeof(fblText),"{FFFFFF}Möchtest du das Fahrzeug deiner Fraktion kaufen?\n\n{F3FF02}Fahrzeugname: %s\nPreis: $%d\n\n{FFFFFF}Um das Fahrzeug zu kaufen benutze den Button 'Ja', um es nicht zu kaufen den Button 'Nein'.",fCarName[FactionBuylist[fbl][fbVehid]-400],FactionBuylist[fbl][fbPrice]);
ShowPlayerDialog(playerid,DIALOG_FACTION_CAR_BUY,DIALOG_STYLE_MSGBOX,"{FFFFFF}Fraktionsautohaus:",fblText,"Nein","Ja");
}else{
SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht brechtigt Fraktionsfahrzeuge zu kaufen!");
new Float:pPos[3];
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
}break;
}
}
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
if(FactionCars[fc][fCarid] == GetPlayerVehicleID(playerid)){
for(new f;f<5;f++){
if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerFaction(playerid) == FactionCars[fc][fFaction][f])
return true;
}
SendClientMessage(playerid,FACTION_COL_GREY,"Du bestitzt für dieses Fahrzeug keine Schlüssel, du verlässt das Fahrzeug.");
RemovePlayerFromVehicle(playerid);
return true;
}
}
}
}return 1;
}
forward FRAC_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
public FRAC_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
if(dialogid == DIALOG_FACTION_CAR_BUY){
if(response){
new Float:pPos[3];
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
TogglePlayerControllable(playerid,true);
}
if(!response){
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
if(IsAllowedFactionToBuy(GetPlayerLeader(playerid))){
if(GetFactioncarsOfFaction(GetPlayerLeader(playerid)) < MAX_BUY){
new Carid1 = GetPlayerVehicleID(playerid);
for(new fbl;fbl<sizeof(FactionBuylist);fbl++){
if(Carid1 == FactionBuylist[fbl][fbCarid]){
if(GetPlayerMoney(playerid) >= FactionBuylist[fbl][fbPrice]){
//if(CallRemoteFunction("Script_GetPlayerMoney","i",playerid) >= FactionBuylist[fbl][fbPrice]){
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] < 400 || FactionCars[fc][fVehid] > 611){
FactionCars[fc][fVehid] = FactionBuylist[fbl][fbVehid];
FactionCars[fc][fPos][0] = FactionBuySpawn[0];
FactionCars[fc][fPos][1] = FactionBuySpawn[1];
FactionCars[fc][fPos][2] = FactionBuySpawn[2];
FactionCars[fc][fPos][3] = FactionBuySpawn[3];
new Color[2];
GetDefaultCarColorOfFaction(GetPlayerLeader(playerid),Color[0],Color[1]);
FactionCars[fc][fCol][0] = Color[0];
FactionCars[fc][fCol][1] = Color[1];
FactionCars[fc][fPrice] = FactionBuylist[fbl][fbPrice];
for(new slot;slot<14;slot++)
FactionCars[fc][fTuning][slot] = 0;
FactionCars[fc][fCarid] = CreateVehicle(FactionCars[fc][fVehid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2],FactionCars[fc][fPos][3],FactionCars[fc][fCol][0],FactionCars[fc][fCol][1],-255);
print(">>> Nach dem Autoerstellen!");
#if defined FACTION_CARS_LOCKABLE
fLockCar(FactionCars[fc][fCarid]);
FactionCars[fc][fLocked] = true;
#endif
for(new f;f<5;f++)
{
FactionCars[fc][fFaction][f] = -255;
}
FactionCars[fc][fFaction][0] = GetPlayerLeader(playerid);
PutPlayerInVehicle(playerid,FactionCars[fc][fCarid],0);
GivePlayerMoney(playerid, -FactionBuylist[fbl][fbPrice]);
//CallRemoteFunction("Script_SetPlayerMoney","id",playerid,(CallRemoteFunction("Script_GetPlayerMoney","i",playerid)-FactionBuylist[fbl][fbPrice]));
new Float:pPos[3];
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
TogglePlayerControllable(playerid,true);
SendClientMessage(playerid,FACTION_COL_YELLOW,"Glückwunsch zum neuen Fahrzeug.");
SendClientMessage(playerid,FACTION_COL_YELLOW,"Bitte vergesse nicht das Fahrzeug mit: '/fpark' umzuparken.");
SendClientMessage(playerid,FACTION_COL_YELLOW,"Das Fahrzeug steht am Ausgabepunkt bereit!");
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
{
ChangeVehicleColor(FactionCars[fc][fCarid],0,0);
}
else if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
ChangeVehicleColor(FactionCars[fc][fCarid],15,15);
}
else if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
ChangeVehicleColor(FactionCars[fc][fCarid],1,1);
}
else if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
ChangeVehicleColor(FactionCars[fc][fCarid],16,16);
}
else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
ChangeVehicleColor(FactionCars[fc][fCarid],5,5);
}
else if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
ChangeVehicleColor(FactionCars[fc][fCarid],6,6);
}
else if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
ChangeVehicleColor(FactionCars[fc][fCarid],7,7);
}
else if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
ChangeVehicleColor(FactionCars[fc][fCarid],12,12);
}
else if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
{
ChangeVehicleColor(FactionCars[fc][fCarid],151,151);
}
else if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
{
ChangeVehicleColor(FactionCars[fc][fCarid],1,1);
}
else if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21)
{
ChangeVehicleColor(FactionCars[fc][fCarid],0,0);
}
else if(PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23)
{
ChangeVehicleColor(FactionCars[fc][fCarid],1,1);
}
return 1;
}
}SendClientMessage(playerid,FACTION_COL_GREY,"Die maximale Anzahl von Fraktionsfahrzeugen ist bereits erreicht.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du hast nicht genügend Geld bei dir!");
break;
}
}
}else SendClientMessage(playerid,FACTION_COL_GREY,"Deine Fraktion hat das Limit von Fahrzeugen bereits erreicht.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht brechtigt Fraktionsfahrzeuge zu kaufen!");
new Float:pPos[3];
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0]+2.5,pPos[1]+2.5,pPos[2]);
TogglePlayerControllable(playerid,true);
}
}return 1;
}return 0;
}