Hab mal wieder nen fehler
wenn ich "Kaufen" drücke dann stürtzt der Server ab wieso?
Mein kaufdialog:
new string[256], sts[128], name[MAX_PLAYER_NAME];
if(dialogid == Dialog0)
{
if(response == 1)
{
if(PlayerInfo[playerid][pKey] > 0)
{
SendClientMessage(playerid, COLOR_RED,"Du besitzt schon ein Auto !");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
new prus;
if(SInfo[playerid][pBargeld] >= prus)
{
GivePlayerMoney(playerid, -preis[playerid]);
PlayerInfo[playerid][pPreis] = preis[playerid];
format(string, sizeof(string),"769.4449, -1327.1703, 13.3326, 268.7346, 0, 0, %d, %d",GetVehicleModel(GetPlayerVehicleID(playerid)),preis[playerid]);
SaveVehicles(string, playerid);
PlayerInfo[playerid][pKey] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)), 769.4449,-1327.1703,13.3326,268.7346,0,0,-1);
GetPlayerName(playerid, name, sizeof(name));
format(sts, sizeof(sts),"%s",name);
SetVehicleNumberPlate(PlayerInfo[playerid][pKey], sts);
SetVehicleToRespawn(PlayerInfo[playerid][pKey]);
SetPlayerPos(playerid, 769.7058,-1324.5464,13.3906);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
format(str, sizeof(str),"Auto erfolgreich für %d$ gekauft !",preis[playerid]);
SendClientMessage(playerid, Blau, str);
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_RED,"Du besitzt zu wenig Geld für dieses Auto !");
return 1;
}
}
if(response == 0)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
Kann nicht GetPlayerMoney benutzen da ich ein iegenes Geldsystem habe