Peršokti į turinį
  • ŽAIDIMAI
  • , ŽAIDIMAI
  • ŽAIDIMAI

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4074 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Recommended Posts

Kaip įdėtį šitą dalyką? Čia c-bug records sistema. Kaip ją įdėt ir kur? : D


 


//----------------------------------------------------------


//

//  CBUG TOP LIST  1.0

//  A CBUG top listing filterscript by `justinnater`

//

//----------------------------------------------------------

 

#include <a_samp>

#include <zcmd>

#include <sscanf2>

#include <dini>

 

#define COLOR_WHITE 0xFFFFFFFF

 

new matching[MAX_PLAYERS];

new ammo[MAX_PLAYERS];

new ptickcount[MAX_PLAYERS];

new Weapons[MAX_PLAYERS][11], Ammo[MAX_PLAYERS][11];

 

#define MAX_CHARS MAX_PLAYER_NAME+1

#define MAX_STRING 256

 

new Float:*Myliu SuperGames.lt*[MAX_PLAYERS],Float:py[MAX_PLAYERS],Float:pz[MAX_PLAYERS];

new

top1,

top2,

top3,

top4,

top5;

 

new

topname1[MAX_STRING],

topname2[MAX_STRING],

topname3[MAX_STRING],

topname4[MAX_STRING],

topname5[MAX_STRING];

 

public OnFilterScriptInit()

{

new file[24];

    format(file,sizeof(file),"cbugrecords.txt");

if(dini_Exists(file)) return loadglobals();

else

{

dini_Create(file);

   dini_IntSet(file,"top1",-1);

   dini_IntSet(file,"top2",-1);

   dini_IntSet(file,"top3",-1);

   dini_IntSet(file,"top4",-1);

   dini_IntSet(file,"top5",-1);

   dini_Set(file,"topname1","None");

   dini_Set(file,"topname2","None");

   dini_Set(file,"topname3","None");

   dini_Set(file,"topname4","None");

   dini_Set(file,"topname5","None");

loadglobals();

}

for(new h=0; h<=MAX_PLAYERS; h++)

{

   if(IsPlayerConnected(h))

   {

matching[h]=0;

ammo[h]=-1;

   }

}

return 1;

}

public OnFilterScriptExit()

{

new file[24];

    format(file,sizeof(file),"cbugrecords.txt");

  dini_IntSet(file,"top1",top1);

  dini_IntSet(file,"top2",top2);

  dini_IntSet(file,"top3",top3);

  dini_IntSet(file,"top4",top4);

  dini_IntSet(file,"top5",top5);

 

  dini_Set(file,"topname1",topname1);

  dini_Set(file,"topname2",topname2);

  dini_Set(file,"topname3",topname3);

  dini_Set(file,"topname4",topname4);

  dini_Set(file,"topname5",topname5);

  return 1;

}

public OnPlayerConnect(playerid)

{

matching[playerid]=0;

ammo[playerid]=-1;

return 1;

}

public OnPlayerUpdate(playerid)

{

if(matching[playerid]==1 && GetPlayerWeapon(playerid)==24)

{

new playerammo=GetPlayerAmmo(playerid);

if(playerammo!=ammo[playerid])

{

   ammo[playerid]=playerammo;

   if(ammo[playerid]==6) return ptickcount[playerid]=GetTickCount();

   if(ammo[playerid]==0)

   {

       ammo[playerid]=-1;

       matching[playerid]=0;

new string[32];

new time=GetTickCount()-ptickcount[playerid];

   format(string,sizeof(string),"Time: %s seconds (/records)",Comma(time));

   SendClientMessage(playerid,COLOR_WHITE,string);

   SetPlayerPos(playerid,*Myliu SuperGames.lt*[playerid],py[playerid],pz[playerid]);

   for(new j=0; j<11; j++) GivePlayerWeapon(playerid, Weapons[playerid][j], Ammo[playerid][j]);

   if(top1==-1)

   {

       top1=time;

       topname1=PlayerName(playerid);

       return 1;

   }

   else if(time<top1)

{

                top5=top4;

                top4=top3;

                top3=top2;

                top2=top1;

                top1=time;

                topname5=topname4;

                topname4=topname3;

                topname3=topname2;

                topname2=topname1;

                topname1=PlayerName(playerid);

                return 1;

}

   else if(top2==-1)

   {

       top2=time;

       topname2=PlayerName(playerid);

       return 1;

   }

   else if(time<top2)

   {

                top5=top4;

                top4=top3;

                top3=top2;

                top2=time;

                topname5=topname4;

                topname4=topname3;

                topname3=topname2;

                topname2=PlayerName(playerid);

       return 1;

   }

   else if(top3==-1)

{

   top3=time;

                    topname3=PlayerName(playerid);

                    return 1;

}

   else if(time<top3)

   {

                top5=top4;

                top4=top3;

                top3=time;

                topname5=topname4;

                topname4=topname3;

                topname3=PlayerName(playerid);

       return 1;

   }

   else if(top4==-1)

   {

       top4=time;

       topname4=PlayerName(playerid);

       return 1;

   }

   else if(time<top4)

   {

                top5=top4;

                top4=time;

                topname5=topname4;

                topname4=PlayerName(playerid);

       return 1;

   }

   else if(top5==-1)

{

   top5=time;

   topname5=PlayerName(playerid);

   return 1;

}

   else if(time<top5)

   {

       top5=time;

       topname5=PlayerName(playerid);

       return 1;

   }

       return 1;

   }

}

}

return 1;

}

CMD:cbug(playerid,params[])

{

new Float:x,Float:y,Float:z;

GetPlayerPos(playerid,x,y,z);

*Myliu SuperGames.lt*[playerid]=x,py[playerid]=y,pz[playerid]=z;

for(new j=0; j<11; j++) GetPlayerWeaponData(playerid, j, Weapons[playerid][j], Ammo[playerid][j]);

ResetPlayerWeapons(playerid);

GivePlayerWeapon(playerid,24,7);

ammo[playerid]=7;

matching[playerid]=1;

SetPlayerPos(playerid,1544.1321,-1353.3595,329.4742);

return 1;

}

CMD:records(playerid,params[])

{

new string[512];

    format(string,sizeof(string),"1: %s [%s]\n2: %s [%s]\n3: %s [%s]\n4: %s [%s]\n5: %s [%s]",Comma(top1),topname1,Comma(top2),topname2,Comma(top3),topname3,Comma(top4),topname4,Comma(top5),topname5);

ShowPlayerDialog(playerid, 4313, DIALOG_STYLE_MSGBOX, "Records:", string, "Close", "");

return 1;

}

stock Comma(numbers) //by Gamer931215

{

    new temp[24],counter = -1;

    valstr(temp,numbers);

    for(new i = strlen(temp);i > 0; i--)

    {

        counter++;

        if(counter == 3)

        {

            strins(temp,",",i);

            counter = 0;

        }

    }

    return temp;

}

stock PlayerName(playerid)

{

  new name[MAX_PLAYER_NAME];

  GetPlayerName(playerid, name, MAX_PLAYER_NAME);

  return name;

}

stock loadglobals()

{

new file[24];

format(file,sizeof(file),"cbugrecords.txt");

top1=dini_Int(file,"top1");

top2=dini_Int(file,"top2");

top3=dini_Int(file,"top3");

top4=dini_Int(file,"top4");

top5=dini_Int(file,"top5");

topname1=dini_Get(file,"topname1");

topname2=dini_Get(file,"topname2");

topname3=dini_Get(file,"topname3");

topname4=dini_Get(file,"topname4");

topname5=dini_Get(file,"topname5");

return 1;

}

nemoku.

 

Ir kuri serverį? ....

 

Atsidarai Pawno, įdedi tą kodą ir sukompiliuoji. Tada .amx failą įkeli ir filterscript aplankalą kur tavo serveris yra. Paskui atsidarai server.cfg ir kur yra eilutė "filterscripts" prirašai to failo pavadinimą (be .amx galūnės).

What's my name? Let's see


sakir as + e


Now read it backwards. Magic? Yep, it's magic.

ką į include kelt? tą .amx failą?

nes susikūriau CBUG.amx įmečiau į filterscripts, bet nepaleidžia servo.

 

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dini>
 
Savo includes aplanke turi failus su šitais pavadinimais? Nors pagal idėja tau net negalėjo leist kompiliuot .amx failo be tų include... O į server.cfg įrašei to filterscripto pavadinimą?

What's my name? Let's see


sakir as + e


Now read it backwards. Magic? Yep, it's magic.

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4074 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Prisijungti prie diskusijos

Palikti atsakymą galite iš karto, o užsiregistruoti vėliau. Jeigu jau turite paskyrą mūsų forume, Prisijunkite.

Svečias
Atsakyti šioje temoje...

×   Įklijuotas tekstas turi teksto formatavimą.   Pašalinti teksto formatavimą

  Galimi tik 75 veidukai.

×   Nuoroda buvo automatiškai įterpta.   Įterpti nuorodą paprastai

×   Jūsų ankstesnis pranešimas buvo atkurtas.   Išvalyti redaktorių

×   Jūs negalite įkelti nuotraukas tiesiogiai.Įkelkite arba įdėkite nuotraukas iš URL.

  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.

Skelbimai


×
×
  • Sukurti naują...