Jump to content

Kvostyc

Uživatel
  • Příspěvků

    79
  • Registrován

  • Aktivní

  • Vítězných dnů

    1

Příspěvky posted by Kvostyc



  1. if(listitem == 1)
                    {
                        new string[128];
                    format(string,sizeof(string),"Kick/%s.log",PlayerName(playerid));
              new File:hFile;
    hFile = fopen(string, io_append);
    if(hFile)
    {
    new str[500];
          while(fread(hFile,str))
       ShowPlayerDialog(playerid,DIALOG_KICK_SUSPECT,DIALOG_STYLE_MSGBOX,"Kick log",str,"Ok","Storno");
       print("str");
    }
    fclose(hFile);
    printf("saf");
                    }


     

    Nakoniec som urobil toto no len nechce to načítať ten dialog

  2. Zdravím,

     

    Mám taký problém, že keď je hráč umlčaný a niečo napíše, tak sa to vypíše do chatu, ale aj mu pošle SCM, že je umlčaný.

     

     

    public OnPlayerText(playerid, text[])
    {
        new string[128], name[24];
        GetPlayerName(playerid,name,24);
    format(string,128, "{FF8200}%s{FFFFFF}(%d): %s",name,playerid,text);
    SendClientMessageToAll(-1, string);
    if(IsMuted[playerid] == 1)
    {
       SendClientMessage(playerid,cervena,"[ ! ]{f0f0f0}Si umlčaný");
       return 0;
    }
    return 0;
    }
     
    
  3. Mám taký problém, že keď mám pod 75hp tak stále tam je biela farba u stavu

     

     

     

    public SekundTimer(playerid)
    {
     
    for(new i; i<MAX_PLAYERS; i++)
    {
    new LuxZone[MAX_ZONE_NAME];
    GetPlayer2DZone(i, LuxZone, MAX_ZONE_NAME);
    if(IsPlayerInAnyVehicle(i) && IsPlayerConnected(i) && GetPlayerVehicleID(i) != 481 && GetPlayerVehicleID(i) != 509 && GetPlayerVehicleID(i) != 510)
    {
    new str[128];
    new Float:VHP;
    GetVehicleHealth(GetPlayerVehicleID(i),VHP);
    format(str,sizeof(str),"~r~RYCHLOST: ~w~%d KM/H~n~~r~STAV: ~w~%.1f %%~n~~r~VOZIDLO: ~w~%s~n~~r~GPS: ~w~%s",GetVehicleSpeed(i,true),VHP/10,VehName[GetVehicleModel(GetPlayerVehicleID(i))-400],LuxZone);
    if(GetVehicleHealth(GetPlayerVehicleID(i),VHP) < 750.00)
    {
       new str2[128];
       format(str2,sizeof(str2),"~r~RYCHLOST: ~w~%d KM/H~n~~r~STAV: ~y~%.1f %%~n~~r~VOZIDLO: ~w~%s~n~~r~GPS: ~w~%s",GetVehicleSpeed(i,true),VHP/10,VehName[GetVehicleModel(GetPlayerVehicleID(i))-400],LuxZone);
       TextDrawSetString(Tachometer[i],str2);
    }
    if(GetVehicleHealth(GetPlayerVehicleID(i),VHP) < 399.99)
    {
       new st[128];
       format(st,sizeof(st),"~r~RYCHLOST: ~w~%d KM/H~n~~r~STAV: ~r~%.1f %%~n~~r~VOZIDLO: ~w~%s~n~~r~GPS: ~w~%s",GetVehicleSpeed(i,true),VHP/10,VehName[GetVehicleModel(GetPlayerVehicleID(i))-400],LuxZone);
       TextDrawSetString(Tachometer[i],st);
    }
        TextDrawSetString(Tachometer[i],str);
       TextDrawShowForPlayer(playerid,Tachometer[i]);
    }
    }
    return 1;
    }
  4. čus mám urobenú registráciu cez dini ale ked sa odpojím tak sa mi nevytvára zložka

     

     

    onplayerdisconnect:

     

     

     

     

     

     

    new cesta[50];
    format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));
    if(dini_Exists(cesta))
    {
       dini_Create(cesta);
       GetPlayerHealth(playerid,pInfo[playerid][pHealth]);
       GetPlayerArmour(playerid,pInfo[playerid][pArmour]);
    GetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
    dini_IntSet(cesta,"Heslo",pInfo[playerid][Heslo]);
    dini_Set(cesta, "Meno", PlayerName(playerid));
    dini_FloatSet(cesta, "X", pInfo[playerid][pX]);
    dini_FloatSet(cesta, "Y", pInfo[playerid][pY]);
    dini_FloatSet(cesta, "Z", pInfo[playerid][pZ]);
    dini_IntSet(cesta, "AdminLevel", pInfo[playerid][pAdminLevel]);
    dini_IntSet(cesta, "Money", GetPlayerMoney(playerid));
    dini_IntSet(cesta, "Skin", GetPlayerSkin(playerid));
    dini_BoolSet(cesta, "Vodicak", pInfo[playerid][Vodicak]);
    dini_IntSet(cesta, "WantedLevel", GetPlayerWantedLevel(playerid));
    dini_FloatSet(cesta, "HP", floatround(pInfo[playerid][pHealth]));
    dini_FloatSet(cesta, "Vesta", floatround(pInfo[playerid][pArmour]));
    dini_IntSet(cesta, "Vezenie", pInfo[playerid][Vezenie]);
    }
    
    
    
    
    
    
    
    
    dialogy:
    
    
    
    
    if(dialogid == DIALOG_REGISTER)
    {
             
           if(response)
    {
               if(strlen(inputtext))
    {
    new cesta[50];
    format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));
       GetPlayerHealth(playerid,pInfo[playerid][pHealth]);
       GetPlayerArmour(playerid,pInfo[playerid][pArmour]);
    GetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
    dini_Create(cesta);
    dini_IntSet(cesta,"Heslo",num_hash(inputtext));
    dini_Set(cesta, "Meno", PlayerName(playerid));
    dini_FloatSet(cesta, "X", pInfo[playerid][pX]);
    dini_FloatSet(cesta, "Y", pInfo[playerid][pY]);
    dini_FloatSet(cesta, "Z", pInfo[playerid][pZ]);
    dini_IntSet(cesta, "AdminLevel", pInfo[playerid][pAdminLevel]);
    dini_IntSet(cesta, "Money", GetPlayerMoney(playerid));
    dini_IntSet(cesta, "Skin", GetPlayerSkin(playerid));
    dini_BoolSet(cesta, "Vodicak", pInfo[playerid][Vodicak]);
    dini_IntSet(cesta, "WantedLevel", GetPlayerWantedLevel(playerid));
    dini_FloatSet(cesta, "HP", floatround(pInfo[playerid][pHealth]));
    dini_FloatSet(cesta, "Vesta", floatround(pInfo[playerid][pArmour]));
    dini_IntSet(cesta, "Vezenie", pInfo[playerid][Vezenie]);
               }
           }
           else
    {
               Kick(playerid);
           }
         }
         if(dialogid == DIALOG_LOGIN)
    {
    new cesta[50];
    format(cesta, sizeof(cesta), "/PlayerInfo/%s.ini", PlayerName(playerid));
            if(response)
    {
                if(strlen(inputtext))
    {
                     if(num_hash(inputtext) != dini_Int(cesta, "Heslo"))
    {
                         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Zadaj heslo", "Ok", "Cancel");
                     }
                     else
    {
    strmid(PlayerName(playerid), dini_Get(cesta, "Meno"), false, strlen(dini_Get(cesta, "Meno")), MAX_PLAYER_NAME);
    pInfo[playerid][pX] = dini_Float(cesta, "X");
    pInfo[playerid][pY] = dini_Float(cesta, "Y");
    pInfo[playerid][pZ] = dini_Float(cesta, "Z");
    pInfo[playerid][pAdminLevel] = dini_Int(cesta, "AdminLevel");
    pInfo[playerid][Vodicak] = dini_Bool(cesta, "Vodicak");
    GivePlayerMoney(playerid, dini_Int(cesta, "Money"));
    pInfo[playerid][pHealth] = dini_Float(cesta, "HP");
    pInfo[playerid][pArmour] = dini_Float(cesta, "Vesta");
    SetPlayerSkin(playerid, dini_Int(cesta, "Skin"));
    SetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
    SetPlayerHealth(playerid,pInfo[playerid][pHealth]);
    SetPlayerArmour(playerid,pInfo[playerid][pArmour]);
                     }
         }
             }
            else
    {
                Kick(playerid);
            }
            }
    }

     

  5. čus všetko mi v poho ukladá, ale ked dám /gangy tak sa mi neukáže meno gangu ale majiteľš gangu a rešpekt áno
     
     

    CMD:gangy(playerid,params[])
    {
    new GangCesta[50];
      format(GangCesta,sizeof(GangCesta),"/Gangy/%s",gSystem[MenoGangu]);
     
    new string[1000];
    format(string,sizeof(string),"1. {ffff00}Gang: %s {ff0000}Majiteľ: %s {ff00ff}Rešpekt: %d",gSystem[MenoGangu],gSystem[Majitel],gSystem[Respekt]);
      ShowPlayerDialog(playerid,DIALOG_GANGY,DIALOG_STYLE_MSGBOX,"Gangy",string,"Ok","");
    return 1;
    }
    
     
     
     
    if(dialogid == DIALOG_Gang1)
    {
       new GangCesta[50];
       format(GangCesta,sizeof(GangCesta),"/Gangy/%s.ini",inputtext);
       
       if(!response) return 0;
        if(!dini_Exists(GangCesta))
    {
        dini_Create(GangCesta);
    }
    dini_Create(GangCesta);
       dini_Set(GangCesta ,"MenoGangu", inputtext);
       dini_Set(GangCesta, "Majitel", PlayerName(playerid));
       dini_IntSet(GangCesta ,"Respekt", gSystem[Respekt]);
       
       
        strmid(inputtext, dini_Get(GangCesta, "MenoGangu"), false, strlen(dini_Get(GangCesta, "MenoGangu")), 50);
    strmid(gSystem[Majitel], dini_Get(GangCesta, "Majitel"), false, strlen(dini_Get(GangCesta, "Majitel")), MAX_PLAYER_NAME);
    gSystem[Respekt] = dini_Int(GangCesta, "Respekt");
    }
  6. Zdravíčko,

     

    Mám problém keď dám "/jail 0 1 Test" Tak ma to dá na poziciu aj všetko, ale ten timer vynasobí čas*60000 a keď tam dám 1 tak by sa to malo vynasobiť 60000 a to je 1 minuta, ale problém je vtom, že ked tam dám tu 1 minutu tak ma to za tu 1minutu neprepustí

     

    Kod:

     

    CMD:jail(playerid,params[])
    {
    new cas, dovod;
    if(pInfo[playerid][pAdminLevel] < 0)return 0;
    if(!IsPlayerConnected(JailID))return SendClientMessage(playerid,CERVENA,"[ ! ]{f0f0f0}Hráč so zadaným ID nieje online");
    if(sscanf(params,"udz",JailID,cas,dovod))return SendClientMessage(playerid,CERVENA,"[ ! ]Použi: {f0f0f0}/Jail [iD] [Minuty] [Dovod]");
    if(Jailed[JailID] == 1)return SendClientMessage(playerid,CERVENA,"[ ! ]{f0f0f0}Hráč už je zatknutý");
     
    Jailed[JailID] = 1;
    SetPlayerVirtualWorld(JailID,51);
    SetPlayerPos(JailID,214.2509,1873.2167,17.6406);
    JailTimer[JailID] = SetTimerEx("prepustit",60000*cas,0,"i",JailID);
     
    new str[128];
    format(str,sizeof(str),"Administátor %s zatkol hráča %s na %f minút [Dovod: %s]",PlayerName(playerid),PlayerName(JailID),cas,dovod);
    SendClientMessageToAll(CERVENA,str);
    return 1;
    }
     
     
    ten public:
     
    public prepustit(playerid)
    {
    if(Jailed[JailID] == 1)
    {
    SetPlayerVirtualWorld(JailID,0);
    SetPlayerHealth(JailID,100);
    SetPlayerPos(JailID,0,0,0);
    Jailed[JailID] = 0;
    SetPlayerInterior(JailID, 0);
    }
    return 1;
    }

     

     

  7. čuste takže mám problém. Keď sa odpojím zo servera tak mi to penaize uloží, ale ked prídem na server tak mi to negivne tie peniaze ktore su ulozene v subore

     

    KOD:

     

    toto mám v disconnect

     

    dini_IntSet(cesta, "Money", GetPlayerMoney(pInfo[playerid][pCash]));

     

     

     

     

    a spawn:

     

    pInfo[playerid][pCash] = dini_Int(cesta, "Cash");
    GivePlayerMoney(playerid,pInfo[playerid][pCash]);

     

     

  8. Nazdar,

     

    Mám taký problém, že keď dám /navigace tak sa mi zobrazí dialog medzi výberom mesta, ale keď kliknem napríklad na San Fierro tak sa mi další dialog nezobrazí

     

    KOD:

     

    Toto mám v dialogresponse:

     

       if(dialogid == 100)
    {
        if(listitem == 0) //las venturas
        {
          ShowPlayerDialog(playerid,101,DIALOG_STYLE_LIST,"Las Venturas","Auto predajne","Ok","Storno");
        }
        if(listitem == 1) //san fierro
        {
            ShowPlayerDialog(playerid,102,DIALOG_STYLE_LIST,"San Fierro","Auto predajne","Ok","Storno");
        }
        if(listitem == 2) //los santos
        {
            ShowPlayerDialog(playerid,103,DIALOG_STYLE_LIST,"Los Santos","Auto predajne","Ok","Storno");
    }
        }
     
     
    Samotny príkaz:
     
    CMD:navigace(playerid,params[])
    {
    ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Navigácia - Výber mesta","Las Vegas\nSan Fierro\nLos Santos","Ok","Storno");
    return 1;
    }

     

  9. Dobrý deň,

     

    Vždy ked si vyberem neajkú položku v dialogu tak mi to za pár sekund hodí späť na infernus. Neviem ako to opraviť tak žiadam o pomoc

     

    Kod:

     

    new wangcars; 

     

    public OnGameModeInit();

    {

    wangcars = CreatePickup(1239,24,-1970.7250,297.6281,35.1719,-1);

    return 1;

    }

     

     

    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid == wangcars)
    {
    ShowPlayerDialog(playerid,38,DIALOG_STYLE_LIST,"Wang Cars","Infernus\nCheetah\nBanshee\nHotknife\nTurismo\nZR-350\nComet\nHotring\nHotring A\nHotring B\nSuper GT\nBullet \nWindsor","Kupit","Storno");
    }
    return 1;
    }
     
    //je tu skopirovany iba ten dialog a nie cely public OnDialogResponse
    if(dialogid == 38)
    {
       if(response)
       {
           if(listitem == 0)
           {
               if(GetPlayerMoney(playerid) < 89950) return func1(playerid,-1,"Nedostatok financíí"); //infernus
               {
                   new car, Float:X,Float:Y,Float:Z;
                   GetPlayerPos(playerid,X,Y,Z);
                        car = CreateVehicle(411,X,Y,Z,0,0,0,0);
                        PutPlayerInVehicle(playerid,car,0);
                        GivePlayerMoney(playerid,-89950);
                         SetVehicleNumberPlate(car,"Infernus");
               }
           }
           if(listitem == 1)
           {
               if(GetPlayerMoney(playerid) < 119000) return func1(playerid,-1,"Nedostatok financíí"); //cheetah
               {
                   new car, Float:X,Float:Y,Float:Z;
                   GetPlayerPos(playerid,X,Y,Z);
                        car = CreateVehicle(415,X,Y,Z,0,0,0,0);
                        PutPlayerInVehicle(playerid,car,0);
                        GivePlayerMoney(playerid,-119000);
                        SetVehicleNumberPlate(car,"Cheetah");
               }
           }
             if(listitem == 2)
           {
               if(GetPlayerMoney(playerid) < 75999) return func1(playerid,-1,"Nedostatok financíí"); //banshee
               {
                   new car, Float:X,Float:Y,Float:Z;
                   GetPlayerPos(playerid,X,Y,Z);
                        car = CreateVehicle(429,X,Y,Z,0,0,0,0);
                        PutPlayerInVehicle(playerid,car,0);
                        GivePlayerMoney(playerid,-75999);
                        SetVehicleNumberPlate(car,"Banshee");
               }
           }
       }
    }
    return 1;
    }

     

×
×
  • Create New...