Beiträge von aTraX

    so gehts 100%.


    new Menu:BSNMenu;


    forward MenuFreeze(playerid);


    public OnGameModeInit()
    {
    BSNMenu = CreateMenu("BSNMenu", 2, 50.0, 180.0, 200.0, 200.0);


    AddMenuItem(Menu:BSNMenu, 0, "Hamburger");
    AddMenuItem(Menu:BSNMenu, 1, "100 Dollar");
    AddMenuItem(Menu:BSNMenu, 0, "Cürry Wurst");
    AddMenuItem(Menu:BSNMenu, 1, "80 Dollar");
    AddMenuItem(Menu:BSNMenu, 0, "Pommes");
    AddMenuItem(Menu:BSNMenu, 1, "60 Dollar");
    AddMenuItem(Menu:BSNMenu, 0, "CocaCola");
    AddMenuItem(Menu:BSNMenu, 1, "50 Dollar");
    AddMenuItem(Menu:BSNMenu, 0, "Fanta");
    AddMenuItem(Menu:BSNMenu, 1, "50 Dollar");
    AddMenuItem(Menu:BSNMenu, 0, "Mixery");
    AddMenuItem(Menu:BSNMenu, 1, "60 Dollar");
    AddMenuItem(Menu:BSNMenu, 0, "Urpils");
    AddMenuItem(Menu:BSNMenu, 1, "60 Dollar");
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp(cmdtext, "/menu", true) == 0)
    {
    if (PlayerToPoint(2, playerid, 376.3494, -67.9245, 1001.5151))
    {
    ShowMenuForPlayer(Menu:BSNMenu, playerid);
    }
    return 1;
    }
    return 0;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    new Menu:current;
    current = GetPlayerMenu(playerid);
    if(current == BSNMenu)
    {
    new Float:health;
    switch(row)
    {
    case 0:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.3;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -100);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 5000, 0);
    }
    case 1:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.4;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -80);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 5000, 0);
    }
    case 2:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.2;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -60);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 5000, 0);
    }
    case 3:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.15;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -50);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 3000, 0);
    }
    case 4:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.15;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -50);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 3000, 0);
    }
    case 5:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.18;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -60);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 3000, 0);
    }
    case 6:
    {
    GetPlayerHealth(playerid, health);
    health *= 1.17;
    SetPlayerHealth(playerid, health);
    GivePlayerMoney(playerid, -60);
    TogglePlayerControllable(playerid, 0);
    SetTimer("MenuFreeze", 3000, 0);
    }
    }
    }
    return 1;
    }


    public MenuFreeze(playerid)
    {
    TogglePlayerControllable(playerid, 1);
    return 1;
    }


    :D

    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    SetTimerEx("CheckECar", 1000, 1, "i", playerid);
    return 1;
    }


    forward CheckECar();
    public CheckECar()
    {
    for(new i; i < MAX_PLAYERS; i++)
    {
    new veh = GetPlayerVehicleID(i);
    SetVehicleHealth(veh, 1000.0);
    }
    }


    so oder net ?

    also ich hab ein prob undzwar soll man wenn man die Zeile Colt 45 auswählt in dem menü eine 9mm pistole bekommen ! jetzt hab ich es gemacht das wenn man zuwenig money hat sie nicht bekommt !


    case 0: // Colt
    {
    if(GetPlayerMoney(playerid) < 600)
    {
    GivePlayerWeapon(playerid, 22, 0);

    } else {

    SendClientMessage(playerid, COLOR_RED, "ERROR: You haven't got enough money !");
    }
    }


    das geht aber net bekomme error in der Zeile


    main()


    ERROR:


    Code
    (57) : error 001: expected token: ";", but found "-identifier-"


    wer kann helfen ? :D

    so is richtig:


    dcmd_name(playerid,params[])
    {
    new PID, Name[MAX_PLAYERS_NAME];
    if(!IsPlayerAdmin(pID))
    {
    return SendClientMessage(playerid, 0xFF0000FF, "Du bist kein Admin !");
    }
    if(sscanf(params, "uu",pID, Name))
    {
    return SendClientMessage(playerid,0xFFFFFFFF,"TIPPE: /name [playerid] [newname]");
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,0xFF0000FF,"Kein Spieler mit angegebener ID Online");
    }
    SetPlayerName(pID, Name);
    return 1;
    }

    dcmd(name, 4, cmdtext);