HEy Leute wenn ich ein object vor mir spawnen will Crasht der server aber ich weis nit warrum:
Hir der Cod:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == bau)
{
switch(row)
{
case 0: //
{
if (GetPlayerMoney(playerid) > 199)
{
GivePlayerMoney(playerid, -200);
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
CreateObject(3374,X,Y,Z,0.0,0.0,0.0);
SendClientMessage(playerid, COLOR_GREY, "Heuballen für 200$ gekauft!");
HideMenuForPlayer(bau, playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Du hast nicht genügend Geld!");
TogglePlayerControllable(playerid, 1);
return 1;
}
}
case 1: //
{
if (GetPlayerMoney(playerid) > 249)
{
GivePlayerMoney(playerid, -250);
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
CreateObject(970,X,Y,Z,0.0,0.0,0.0);
SendClientMessage(playerid, COLOR_GREY, "kleine Barrikade für 250$ gekauft!");
HideMenuForPlayer(bau, playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Du hast nicht genügend Geld!");
TogglePlayerControllable(playerid, 1);
return 1;
}
}
case 2: //
{
if (GetPlayerMoney(playerid) > 499)
{
GivePlayerMoney(playerid, -500);
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
CreateObject(971,X,Y,Z,0.0,0.0,0.0);
SendClientMessage(playerid, COLOR_GREY, "große Barrikade für 500$ gekauft!");
HideMenuForPlayer(bau, playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Du hast nicht genügend Geld!");
TogglePlayerControllable(playerid, 1);
return 1;
}
}
case 3: //Shotgun
{
if (GetPlayerMoney(playerid) > 199)
{
GivePlayerMoney(playerid, -200);
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
CreateObject(1217,X,Y,Z,0.0,0.0,0.0);
SendClientMessage(playerid, COLOR_GREY, "Tonne für 200$ gekauft!");
HideMenuForPlayer(bau, playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Du hast nicht genügend Geld!");
TogglePlayerControllable(playerid, 1);
return 1;
}
}
case 4: //Sawnoff Shotgun
{
if (GetPlayerMoney(playerid) > 999)
{
GivePlayerMoney(playerid, -1000);
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
CreateObject(1225,X,Y,Z,0.0,0.0,0.0);
SendClientMessage(playerid, COLOR_GREY, "Explosive Tonne für 1000$ gekauft!");
HideMenuForPlayer(bau, playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Du hast nicht genügend Geld!");
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
}
return 1;
}