Hallo, ich hab ein Waffenauto gescriptet, wie krieg ich hin, das der Fahrer das geld bekommt.
Hier sind CodeZeilen fürs Waffenauto
bei den news:
new WAFFENAUTO;
bei OnGameModeInit
WAFFENAUTO = AddStaticVehicle(428,1630.0623,1956.0399,10.9454,178.6646,4,75); // WAFFENAUTO
bei OnPlayerStateChange
{
if(GetPlayerVehicleID(playerid) == WAFFENAUTO)
{
if(playerState == PLAYER_STATE_PASSENGER)
{
ShowPlayerDialog(playerid,WAFFENAUTOMenu,DIALOG_STYLE_LIST,"WAFFENAUTO","Rüstung für 250$\nM4 für 4000$\nDesert Eagle für 2000$\nMP5/SMG für 2500$\nRPG-7 für 10000$","Auswählen","Abbrechen");
}
}
}
if(dialogid == WAFFENAUTOMenu)
{
if(response)
{
if(listitem == 0)
{
SetPlayerArmour(playerid,100);
SendClientMessage(playerid,0x00ff00ff,"Rüstung gekauft xD");
GivePlayerMoney(playerid,-250);
RemovePlayerFromVehicle(playerid);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,31,250);
GivePlayerMoney(playerid,-3500);
SendClientMessage(playerid,0x00ff00ff,"Du hast dir ein M4 gekauft xD");
RemovePlayerFromVehicle(playerid);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,24,100);
GivePlayerMoney(playerid,-2000);
SendClientMessage(playerid,0x00ff00ff,"Du hast dir die Desert Eagle gekauft");
RemovePlayerFromVehicle(playerid);
}
if(listitem == 3)
{
GivePlayerWeapon(playerid,29,300);
GivePlayerMoney(playerid,-2400);
SendClientMessage(playerid,0x00ff00ff,"Du hast dir die MP5/SMG gekauft");
RemovePlayerFromVehicle(playerid);
}
if(listitem == 4)
{
GivePlayerWeapon(playerid,35,5);
GivePlayerMoney(playerid,-10000);
SendClientMessage(playerid,0x00ff00ff,"Du hast dir den Rakentwerfer/RPG-7 gekauft");
RemovePlayerFromVehicle(playerid);
}
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xff0000ff,"Okay, dann nicht");
}
}