Jednostavan brojač online igrača

Započeo Łuk@, Oktobar 15, 2017, 12:47:55 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Tip: FS/Inc/IS
Slike ili Video: //
Opis i dodatne informacije: Kad pogledate kod, nije potreban nikakav tajmer, samo varijabla, sve je testirano i radi bez greške.
Download link:[pawn]//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

#include                                                                                                        "a_samp"
#include                                                                                                         "fixes"

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

main()
   print("\nScript loaded\n");

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

new onlineigraca = 0,
   Text:TEXT[1];

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

public OnGameModeInit()
{
   TEXT[0] = TextDrawCreate(89.555526, 428.435546, "ONLINE_0");
   TextDrawLetterSize(TEXT[0], 0.237777, 1.161954);
   TextDrawAlignment(TEXT[0], 2);
   TextDrawColor(TEXT[0], -1);
   TextDrawSetShadow(TEXT[0], 0);
   TextDrawSetOutline(TEXT[0], 1);
   TextDrawBackgroundColor(TEXT[0], 255);
   TextDrawFont(TEXT[0], 2);
   TextDrawSetProportional(TEXT[0], 1);
   TextDrawSetShadow(TEXT[0], 0);
   return 1;
}

public OnPlayerConnect(playerid)
{
   TextDrawShowForPlayer(playerid, TEXT[0]);
   onlineigraca++;
   static string[4];
   format(string, sizeof(string), "ONLINE %d", onlineigraca);
   TextDrawSetString(TEXT[0], string);
   printf("TRENUTNO ONLINE - %d",onlineigraca);
   return 1;
}

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

public OnPlayerDisconnect(playerid, reason)
{
   onlineigraca--;
   static string[4];
   format(string, sizeof(string), "TRENUTNO ONLINE - %d", onlineigraca);
   TextDrawSetString(TEXT[0], string);
   printf("a %d",onlineigraca);
   return 1;   
}

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

public OnGameModeExit()
{
   TextDrawDestroy(TEXT[0]);
   return 1;
}[/pawn]
Credits: Sjetio sam se da sam Corr***ja pitao prije godinu-dvije, pa se sad sjetio toga
Poslednja Izmena: Oktobar 15, 2017, 12:50:28 POSLE PODNE od Łuk@
heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci

Svidja mi se brt :D
••• Nexus Project Community •••
• Founder & Developer •

A što ako uvezem NPC-a, i tada će mi brojati kao x/x online. Sredi to.
Poslednja Izmena: Oktobar 15, 2017, 13:06:20 POSLE PODNE od Bolex_
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

Citat: Bolex_ poslato Oktobar 15, 2017, 13:05:05 POSLE PODNE
A što ako uvezem NPC-a, i tada će mi brojati kao x/x online. Sredi to.
Eto i to
[pawn]if(!IsPlayerNPC(playerid))[/pawn]

Citat: Bolex_ poslato Oktobar 15, 2017, 13:05:05 POSLE PODNE
A što ako uvezem NPC-a, i tada će mi brojati kao x/x online. Sredi to.
Eto ga hehe
[pawn]//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

#include                                                                                                        "a_samp"
#include                                                                                                         "fixes"

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

main()
   print("\nScript loaded\n");

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

new onlineigraca = 0,
   Text:TEXT[1];

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

public OnGameModeInit()
{
   TEXT[0] = TextDrawCreate(89.555526, 428.435546, "ONLINE_0");
   TextDrawLetterSize(TEXT[0], 0.237777, 1.161954);
   TextDrawAlignment(TEXT[0], 2);
   TextDrawColor(TEXT[0], -1);
   TextDrawSetShadow(TEXT[0], 0);
   TextDrawSetOutline(TEXT[0], 1);
   TextDrawBackgroundColor(TEXT[0], 255);
   TextDrawFont(TEXT[0], 2);
   TextDrawSetProportional(TEXT[0], 1);
   TextDrawSetShadow(TEXT[0], 0);
   printf("a %d",onlineigraca);
   return 1;
}

public OnPlayerConnect(playerid)
{
   if(!IsPlayerNPC(playerid))
   {
      TextDrawShowForPlayer(playerid, TEXT[0]);
      onlineigraca++;
      static string[4];
      format(string, sizeof(string), "ONLINE %d", onlineigraca);
      TextDrawSetString(TEXT[0], string);
      printf("TRENUTNO ONLINE - %d",onlineigraca);
   }
   return 1;
}

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

public OnPlayerDisconnect(playerid, reason)
{
   onlineigraca--;
   static string[4];
   format(string, sizeof(string), "TRENUTNO ONLINE - %d", onlineigraca);
   TextDrawSetString(TEXT[0], string);
   printf("a %d",onlineigraca);
   return 1;   
}

//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~//~~

public OnGameModeExit()
{
   TextDrawDestroy(TEXT[0]);
   return 1;
}[/pawn]

Citat: Tᴇʀᴢɪá´,, Sá´,,ʀɪᴘᴛ poslato Oktobar 15, 2017, 13:07:57 POSLE PODNE
Citat: Bolex_ poslato Oktobar 15, 2017, 13:05:05 POSLE PODNE
A što ako uvezem NPC-a, i tada će mi brojati kao x/x online. Sredi to.
Eto i to
[pawn]if(!IsPlayerNPC(playerid))[/pawn]
ma znam sam
heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci


heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci


heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci

bump
heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci

Pohvale za trud.


bilo je lijepo dok je trajalo.


bump
heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci


heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci

Ukr'o!!!

Šala :D pomoći će nekom sigurno. :)