Servus,
In meinem Bikeshop hat sich ein fehler eingeschlichen den ich eben erst bemerkt habe da ich an etwas anderem gearbeitet habe und der shop eigentlich problemlos funktionierte.
Und zwar werden jetzt plötzlich immer genausoviele bikes von dem ausgewählten erstellt wie der spieler Geld hat. Wenn man zb eine Sanchez für 3178 $ kauft und 32k auf der hand hat , werden 10 Stück davon erstellt. Eben habe ich mir spasseshalber mal 1 Million gegeben woraufhin das spiel natürlich abgestürzt ist
Kannn jemand den Fehler hier zufälig erkennen ?
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == bikeshop)
{
switch(row)
{
case 0: //Sanchez
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerMoney(playerid) >= 3178 )
{
HideMenuForPlayer(bikeshop,playerid);
pInfo[playerid][carowner] = CreateVehicle(468,570.8260,-1300.2391,16.8252,15.6507,75,1,-1);
PutPlayerInVehicle(playerid, pInfo[playerid][carowner], 0);
SetVehicleParamsForPlayer(pInfo[playerid][carowner],i,0,1);
pInfo[playerid][locked] = 1; dini_IntSet(save,"locked",1);
GivePlayerMoney(playerid,-3178);
pInfo[playerid][kaufpreis] = 3178; dini_IntSet(save,"kaufpreis",3178);
SetTimer("bikesave",1000,0);
}}}
case 1: //FCR-900
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerMoney(playerid) >= 4888 )
{
HideMenuForPlayer(bikeshop,playerid);
pInfo[playerid][carowner] = CreateVehicle(521,570.8260,-1300.2391,16.8252,15.6507,75,1,-1); //
PutPlayerInVehicle(playerid, pInfo[playerid][carowner], 0);
SetVehicleParamsForPlayer(pInfo[playerid][carowner],i,0,1);
pInfo[playerid][locked] = 1; dini_IntSet(save,"locked",1);
GivePlayerMoney(playerid,-4888);
pInfo[playerid][kaufpreis] = 4888; dini_IntSet(save,"kaufpreis",4888);
SetTimer("bikesave",1000,0);
}}}
case 2: //PCJ-600
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerMoney(playerid) >= 6679 )
{
HideMenuForPlayer(bikeshop,playerid);
pInfo[playerid][carowner] = CreateVehicle(461,570.8260,-1300.2391,16.8252,15.6507,75,1,-1); //
PutPlayerInVehicle(playerid, pInfo[playerid][carowner], 0);
SetVehicleParamsForPlayer(pInfo[playerid][carowner],i,0,1);
pInfo[playerid][locked] = 1; dini_IntSet(save,"locked",1);
GivePlayerMoney(playerid,-6679);
pInfo[playerid][kaufpreis] = 6679; dini_IntSet(save,"kaufpreis",6679);
SetTimer("bikesave",1000,0);
}}}
case 3: //Wayfarer
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerMoney(playerid) >= 9999 )
{
HideMenuForPlayer(bikeshop,playerid);
pInfo[playerid][carowner] = CreateVehicle(586,570.8260,-1300.2391,16.8252,15.6507,75,1,-1); //
PutPlayerInVehicle(playerid, pInfo[playerid][carowner], 0);
SetVehicleParamsForPlayer(pInfo[playerid][carowner],i,0,1);
pInfo[playerid][locked] = 1; dini_IntSet(save,"locked",1);
GivePlayerMoney(playerid,-9999);
pInfo[playerid][kaufpreis] = 9999; dini_IntSet(save,"kaufpreis",9999);
SetTimer("bikesave",1000,0);
}}}
case 4: //NRG-500
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerMoney(playerid) >= 14689 )
{
HideMenuForPlayer(bikeshop,playerid);
pInfo[playerid][carowner] = CreateVehicle(522,570.8260,-1300.2391,16.8252,15.6507,75,1,-1); //
PutPlayerInVehicle(playerid, pInfo[playerid][carowner], 0);
SetVehicleParamsForPlayer(pInfo[playerid][carowner],i,0,1);
pInfo[playerid][locked] = 1; dini_IntSet(save,"locked",1);
GivePlayerMoney(playerid,-14689);
pInfo[playerid][kaufpreis] = 14689; dini_IntSet(save,"kaufpreis",14689);
SetTimer("bikesave",1000,0);
}}}
case 5: //Verlassen
{
HideMenuForPlayer(bikeshop,playerid);
}}}
MfG
Traxter