[TUT]bar + cigy

    Share

    dajmon
    Nováčik

    Posts : 18
    Join date : 26.04.2011

    [TUT]bar + cigy

    Odoslať pre dajmon za Ut apríl 26, 2011 10:52 am

    tak vam tu zrobim bar ok hore:
    kód:
    new cigy[MAX_PLAYERS];
    new pick;
    do OnGameModeInit
    kód:
    pick = CreatePickup(idpickupu,1,x,y,z,vw);
    no pickup mame a do OnPlayerPickupPickup
    kód:
    if(pickupid == rpick){
    ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Rbar","cigu\nsprite\npivo$\nvino","kúpit","nič");
    }
    do OnDialogResponse
    kód:
    if(dialogid == 3)
    {
    if(response == 1)
    {
    if(listitem == 0)//ak vyberie 1 polosku
    {
    cigy[playerid] += 1;
    }
    if(listitem == 1)//ak vyberie 2 polosku
    {
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
    SendClientMessage(playerid,COLOR_FIALOVA,"kKúpil si si sprite");
    }
    if(listitem == 2)//ak vyberie 3 polosku
    {
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    SendClientMessage(playerid,COLOR_FIALOVA,"Kúpil si si pivo");
    }
    if(listitem == 3)//ak vyberie 4 polosku
    {
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
    SendClientMessage(playerid,COLOR_FIALOVA,"Kúpil si si víno");
    }
    }
    }
    no to by bolo este prikay /vykurit a /cigy
    takze do OnPlayerCommandText
    kód:
    dcmd(vykurit,7,cmdtext);
    dcmd(cigy,4,cmdtext);

    no a dole do modu:
    /vykurit:
    kód:
    dcmd_vykurit(playerid, params[])
    {
    #pragma unused params
    if(cigy[playerid] == 0) return SendClientMessage(playerid,0xFF0000AA,"Nemáš cigaretu");
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
    SendClientMessage(playerid,0xFF0000AA,"dymi sa s teba jak s lokomotivy :D");
    cigy[playerid] -= 1;
    return 1;
    }

    /cigy - to je na info kolko ma cigariet
    kód:
    dcmd_cigy(playerid,params[])
    {
    new string[256];
    format(string,sizeof(string), "=mas %d cigariet =",cigy[playerid]);
    SendClientMessageToAll(COLOR_FIALOVA,string);
    return 1;
    }

    to je vsetko samozrejme su viac specialne akcie ako tanec:
    kód:
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);

      Práve je Št december 13, 2018 7:14 am