Korisne Komande x Funkcije!? (Čitajte ovdje)

Započeo imnaithan, Jun 30, 2019, 20:26:22 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Ova tema služi isključivo za postavljanje Korisnih Komandi x Funkcija.
Korisne Komande mozete postati po sledećim pravilima:


[b]- Vaše ime na forumu:[/b] [i]Tekst ovdje[/i]
[b]- Komanda x Funkcija :[ pawn ]Tekst ovdje [ /pawn ]
[b]- Opis:[/b] [i]Tekst ovdje[/i]
[b]- Dodatak:[/b] [i]Tekst ovdje[/i]
[b]- Credits:[/b] [i]Tekst ovdje[/i]
[i]
[b]- Slike:[/b]
[ img ] [ /img ] ili Link Slika!

*Spojite zagrade da budu uz  "pawn" i "/pawn"
*Opis - Opis Komande i sta ona radi.
*Dodatak - Potrebne stvari da bi komanda radila.
*Slike - Spojite zagrade da budu uz "img" i "/img" ili postavite link.



Ne smijete pisati komentare tipa "nevalja to" , zahvale dajete putem digmeta "Zahvali Se" dok prijave na komande mozete poslati meni
Poslednja Izmena: Oktobar 17, 2019, 22:29:05 POSLE PODNE od Fqris




Give Honor To The One Who Deserve It





- Vaše ime na forumu: M0nster
- Komanda:
Citathttps://pastebin.com/bwHWWH6J
- Opis: Radi se o listi 20 najbogatijih igraca na serveru (online). Odradit ću I offline za YINI kada mi se bude dalo. 
- Dodatak: Potreban vam je ovaj include:
Citathttps://raw.githubusercontent.com/oscar-broman/md-sort/master/md-sort.inc
- Credits: M0nster, Slice (md-sort inc)

- Slike:


Poslednja Izmena: Jun 30, 2019, 20:49:56 POSLE PODNE od Mister Naithan
You'll be always in my heart, the end and thanks for amazing times. #WeAreLords

- Vaše ime na forumu: M0nster
- Komanda:
Citathttps://pastebin.com/0hDWVaQG
- Opis: Komandom provjeravate igracev FPS.
- Dodatak: N/A
- Credits: M0nster, @mumitza. za (CMD:fps).
- Slike: Znate cemu sluzi

You'll be always in my heart, the end and thanks for amazing times. #WeAreLords

- Vaše ime na forumu: M0nster
- Komanda:
Citathttps://pastebin.com/9NsNJh6q
- Opis: Report System. Sastoji se od jedne komande za igraca (/report) i tri za administratora (/reports - za pregled svih reporta, /ar - za prihvacanje reporta i /dr za odbijanje reporta.)
- Dodatak: Prilagodite svom modu, nemojte samo ubaciti i ocekivati da ce raditi.
- Credits: M0nster

- Slike:




You'll be always in my heart, the end and thanks for amazing times. #WeAreLords

- Vaše ime na forumu: Osamu Dazai
- Komanda x Funkcija : [pawn]forward [MAX_PLAYER_NAME + 1]GetName(playerid);
stock GetName(playerid)
{
   #assert MAX_PLAYER_NAME + 1 == 25
   #emit PUSH.C 25
   #emit PUSH.S 16
   #emit PUSH.S playerid
   #emit PUSH.C 12
   #emit SYSREQ.C GetPlayerName
   #emit STACK 16
   #emit RETN
}[/pawn]
- Opis: GetName ali malo brži nego što klasičan što koristite.
- Dodatak: Ako već koristite GetName ili stock funkciju za ime, evo najbrži mogući način.
- Credits: Osamu Dazai - Code
Poslednja Izmena: Avgust 20, 2019, 12:08:50 POSLE PODNE od imnaithan
My tutorials: y_inline & y_dialog, Ternary Operator, y_flooding, y_bit, samp-logger, Pawn Plus I Deo ( Dynamic Strings ), Map Zones, TextDraw Buttons, y_iterate, easyDialog, samp-plugin-timerfix
My includes: TextDraw Buttons


Respect: Bunta, Vedran, Ivan Bagarić, Itz.Yansi, Rade Ćurić (ni ja ne verujem)
Biggest respect goes to: ADRFranklin


Citat: Vodka PlayObožavam te "skriptere" koji probleme rešavaju tako što menjaju mod svaka 2 dana, tako će sigurno naučiti.
Neko im nacrta u temi Å¡ta treba uraditi, al' ne vredi nisu svi za skriptanje.

- Vase ime na forumu: Fiddleshock
- Komanda x Funkcija :[pawn]stock playerInWater(playerid) {
    new
        lib[16],
        animations[32]
    ;

    GetAnimationName(GetPlayerAnimationIndex(playerid), lib, sizeof(lib), animations, sizeof(animations));

   if(!isnull(lib) && !strcmp(lib, "SWIM")) return 1;
    switch(GetPlayerAnimationIndex(playerid)) {
      case 1538..1542,1544,1250,1062: return 1;
      default: return 0;
   }
    return 0;
}[/pawn]
- Opis: Sama funkcija govori opis, tu sam radio test na slici, usao sam u vodu i izbacilo mi je da sam u vodi, izadjem iz vode i pise mi da nisam u vodi, nista vise od toga.. Evo i kako se koristi mada msm da je nepotrebno ali dobro: [pawn]// Example command:
COMMAND:checkwater(playerid, const params[]) {
   if (!playerInWater(playerid))
      return SendClientMessage(playerid, -1, "Nisi u vodi!");
   
   if (playerInWater(playerid))
      return SendClientMessage(playerid, -1, "U vodi si!");
   return 1;
}[/pawn]

- Dodatak: //
- Credits: //

- Slike:

- Vaše ime na forumu: El Faydee
- Komanda x Funkcija :[pawn]
COMMAND:converteur(playerid, const params[]) {
   if (sscanf(params, "i", params[0]))
      return SendClientMessage(playerid, -1, "/converteur <euro>");

   new string[128];
   format(string, sizeof(string), "EUR: %d / RSD: %d", params[0], (params[0] * 127));
   SendClientMessage(playerid, -1, string);
   return 1;
}
// USD: (params[0] * 106) i ostalo..
[/pawn]
- Opis: Konvertovanje novca..
- Dodatak: //
- Credits: //

- Slike:
[ img ] [ /img ] ili Link Slika!

Molim bez dalje rasprave..

TIIIIIRRRRRRUUUUUU RIIIIIIIIIIIIIIIII RUUUUUUUUUUUUU

- Vaše ime na forumu: P47R14RCH
- Komanda x Funkcija:
[pawn]ProxDetector(Float:radius, playerid, const input[], c1, c2, c3, c4, c5, va_args<>)
{
   new
      string[YSI_MAX_STRING],
      Float:pPosX,
      Float:pPosY,
      Float:pPosZ,
      Float:oldpPosX,
      Float:oldpPosY,
      Float:oldpPosZ,
      Float:tmpPosX,
      Float:tmpPosY,
      Float:tmpPosZ;
      
   va_format(string, sizeof string, input, va_start<8>);
   GetPlayerPos(playerid, oldpPosX, oldpPosY, oldpPosZ);
   foreach(new i : StreamedPlayer[playerid])
   {
      GetPlayerPos(i, pPosX, pPosY, pPosZ);
      tmpPosX = (oldpPosX -pPosX);
      tmpPosY = (oldpPosY -pPosY);
      tmpPosZ = (oldpPosZ -pPosZ);

      if(((tmpPosX < radi/16) && (tmpPosX > -radi/16)) && ((tmpPosY < radi/16) && (tmpPosY > -radi/16)) && ((tmpPosZ < radi/16) && (tmpPosZ > -radi/16)))
      {
         SendClientMessage(i, c1, string);
      }
      else if(((tmpPosX < radi/8) && (tmpPosX > -radi/8)) && ((tmpPosY < radi/8) && (tmpPosY > -radi/8)) && ((tmpPosZ < radi/8) && (tmpPosZ > -radi/8)))
      {
         SendClientMessage(i, c2, string);
      }
      else if(((tmpPosX < radi/4) && (tmpPosX > -radi/4)) && ((tmpPosY < radi/4) && (tmpPosY > -radi/4)) && ((tmpPosZ < radi/4) && (tmpPosZ > -radi/4)))
      {
         SendClientMessage(i, c3, string);
      }
      else if(((tmpPosX < radi/2) && (tmpPosX > -radi/2)) && ((tmpPosY < radi/2) && (tmpPosY > -radi/2)) && ((tmpPosZ < radi/2) && (tmpPosZ > -radi/2)))
      {
         SendClientMessage(i, c4, string);
      }
      else if(((tmpPosX < radi) && (tmpPosX > -radi)) && ((tmpPosY < radi) && (tmpPosY > -radi)) && ((tmpPosZ < radi) && (tmpPosZ > -radi)))
      {
         SendClientMessage(i, c5, string);
      }
   }
   return 1;
}[/pawn]
- Opis: Ovo je isto kao: [pawn]public ProxDetector(Float:radi, playerid, string[],c1,c2,c3,c4,c5)
{
   if(IsPlayerConnected(playerid))
   {
      new Float:pPosX, Float:pPosY, Float:pPosZ;
      new Float:oldpPosX, Float:oldpPosY, Float:oldpPosZ;
      new Float:tmpPosX, Float:tmpPosY, Float:tmpPosZ;
      GetPlayerPos(playerid, oldpPosX, oldpPosY, oldpPosZ);
      foreach(Player,i)
      {
         if(IsPlayerConnected(i))
         {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
               GetPlayerPos(i, pPosX, pPosY, pPosZ);
               tmpPosX = (oldpPosX -pPosX);
               tmpPosY = (oldpPosY -pPosY);
               tmpPosZ = (oldpPosZ -pPosZ);
               if(((tmpPosX < radi/16) && (tmpPosX > -radi/16)) && ((tmpPosY < radi/16) && (tmpPosY > -radi/16)) && ((tmpPosZ < radi/16) && (tmpPosZ > -radi/16)))
               {
                  SendClientMessage(i, c1, string);
               }
               else if(((tmpPosX < radi/8) && (tmpPosX > -radi/8)) && ((tmpPosY < radi/8) && (tmpPosY > -radi/8)) && ((tmpPosZ < radi/8) && (tmpPosZ > -radi/8)))
               {
                  SendClientMessage(i, c2, string);
               }
               else if(((tmpPosX < radi/4) && (tmpPosX > -radi/4)) && ((tmpPosY < radi/4) && (tmpPosY > -radi/4)) && ((tmpPosZ < radi/4) && (tmpPosZ > -radi/4)))
               {
                  SendClientMessage(i, c3, string);
               }
               else if(((tmpPosX < radi/2) && (tmpPosX > -radi/2)) && ((tmpPosY < radi/2) && (tmpPosY > -radi/2)) && ((tmpPosZ < radi/2) && (tmpPosZ > -radi/2)))
               {
                  SendClientMessage(i, c4, string);
               }
               else if(((tmpPosX < radi) && (tmpPosX > -radi)) && ((tmpPosY < radi) && (tmpPosY > -radi)) && ((tmpPosZ < radi) && (tmpPosZ > -radi)))
               {
                  SendClientMessage(i, c5, string);
               }
         }   }
      }
   }
   return 1;
}[/pawn] samo 200000% opt

- Dodatak: Nisam testirao ali trebalo bi da radi, mozete napraviti macro da skratite funkciju, primer kako se koristi:
[pawn]// %p je iz formatex-a
// X11_PLUM_1..X11_PLUM_5 je iz y_colours-a
// playerid na kraju je 'macro' za GetName(playerid) (%p)
ProxDetector(15.0, playerid, "* %p is the best.", X11_PLUM_5, X11_PLUM_4, X11_PLUM_3, X11_PLUM_2, X11_PLUM_1, playerid);[/pawn]

- Credits: //

- Slike: //

- Vaše ime na forumu: malitoni in da hood
- Komanda x Funkcija:
[pawn]
stock TextDrawSetStringEx(Text:text, const string[], {Float,_}:...) {
   return TextDrawSetString(Text:text, va_return(string, ___(2)))
}

stock PlayerTextDrawSetStringEx(playerid, PlayerText:text, const string[], {Float,_}:...) {
   return PlayerTextDrawSetString(playerid, PlayerText:text, va_return(string, ___(2)))
}
[/pawn]
- Opis: Sada možete preneti argumente u (Player)TextDrawSetStringEx
- Dodatak: Install YSI 5.1 ako nece da radi.
- Credits: Ja (Author), Y-Less (y_va)
- Slike: //
Poslednja Izmena: Februar 12, 2020, 13:20:45 POSLE PODNE od malitoni in da hood

Citat: malitoni in da hood poslato Februar 12, 2020, 13:16:13 POSLE PODNE
- Vaše ime na forumu: malitoni in da hood
- Komanda x Funkcija:
[pawn]
stock TextDrawSetStringEx(Text:text, const string[], {Float,_}:...) {
   return TextDrawSetString(Text:text, va_return(string, ___(2)))
}

stock PlayerTextDrawSetStringEx(playerid, PlayerText:text, const string[], {Float,_}:...) {
   return PlayerTextDrawSetString(playerid, PlayerText:text, va_return(string, ___(2)))
}
[/pawn]
- Opis: Sada možete preneti argumente u (Player)TextDrawSetStringEx
- Dodatak: Install YSI 5.1 ako nece da radi.
- Credits: Ja (Author), Y-Less (y_va)
- Slike: //
Mislim da si pogresio,
stock PlayerTextDrawSetStringEx(playerid, PlayerText:text, const string[], {Float,_}:...) {
   return PlayerTextDrawSetString(playerid, PlayerText:text, va_return(string, ___(2)))
}
ovde ide  va_return(string, ___(3))), jel tako? Dobro si me naucio hahahah
GAD SAM JA

[pawn]#include <a_samp>
#include <YSI_Coding\y_hooks>

#define ANTICHEAT_STATUS 1
#define MSG SendClientMessage
#define DYNAMIC_MEMORY_IS_DYN 32
#define MSGE SendClientMessageToAll

#if !defined MAX_PLAYER_NAME
#define MAX_PLAYER_NAME 24
#endif

#if !defined MAX_PLAYERS
#define MAX_PLAYERS 1000
#endif

main(){

}

hook OnGameModeInit()
{
   printf("ANTICEHAT BY PJER = UCITANO");
   return 1;
}

hook OnGameModeExit()
{
    printf("ANTICEHAT BY PJER = ODUCITANO");
   return 1;
}

forward [MAX_PLAYER_NAME+1]imeigraca(playerid);
stock imeigraca(playerid)
{
#assert MAX_PLAYER_NAME + 1 == 25
#emit PUSH.C 25
#emit PUSH.S 16
#emit PUSH.S playerid
#emit PUSH.C 12
#emit SYSREQ.C GetPlayerName
#emit STACK 16
#emit RETN
}

stock Float:udaljenost(Float:x1,Float:y1,Float:z1, Float:x2,Float:y2,Float:z2)
{
   return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}

new Float:_LOKACIJA__x[MAX_PLAYERS];
new Float:_LOKACIJA__y[MAX_PLAYERS];
new Float:_LOKACIJA__z[MAX_PLAYERS];
new igracstvoren[MAX_PLAYERS];

forward OnPlayerTeleport(playerid, Float:daljina);
public OnPlayerTeleport(playerid, Float:daljina)
{
    new string[DYNAMIC_MEMORY_IS_DYN+0];// dynamic safe string
    MSG(playerid,-1,"Vi ste kikovani jer koristitie teleport citove.");
    format(string,DYNAMIC_MEMORY_IS_DYN,"%s kikovan citer.", imeigraca(playerid));
    MSGE(-1, string);
   Kick(playerid);
   return (true);
}

hook OnPlayerConnect(playerid)
{
   igracstvoren[playerid] = 0;
   MSG(playerid,-1,"Vi ste promatrani od strane ANTICHEAT BY PJER.");
   return 1;
}

hook OnPlayerSpawn(playerid)
{
   //SetPlayerPos(playerid, 0.0, 0.0, 5.0);
   igracstvoren[playerid] = 1;
   return 1;
}

hook OnPlayerDeath(playerid, killerid, reason)
{
   igracstvoren[playerid] = 0;
   return 1;
}

hook OnPlayerUpdate(playerid)
{
   new Float:dist = 0.0;
   new Float:xplayer[3];
   for(new i = 0; i < MAX_PLAYERS; GetPlayerPos(i,_LOKACIJA__x,_LOKACIJA__y,_LOKACIJA__z[i++])){
      GetPlayerPos(i,xplayer[0],xplayer[1],xplayer[2]);
      if(igracstvoren==0) continue;
       if(udaljenost(xplayer[0],xplayer[1],xplayer[2],_LOKACIJA__x,_LOKACIJA__y,_LOKACIJA__z) > 20.0)
         OnPlayerTeleport(i,dist);
   }
   return 1;
}

[/pawn]

- Vaše ime na forumu: V01D
- Komanda x Funkcija :
[pawn]stock ProxDetector(playerid, Float:max_range, color, const string[], GLOBAL_TAG_TYPES:...)
{
   new
      Float:pos_x,
      Float:pos_y,
      Float:pos_z,
      Float:range,
      Float:range_ratio,
      Float:range_with_ratio,
      clr_r, clr_g, clr_b,
      Float:color_r, Float:color_g, Float:color_b;

   if (!GetPlayerPos(playerid, pos_x, pos_y, pos_z)) {
      return 0;
   }

   color_r = float(color >> 24 & 0xFF);
   color_g = float(color >> 16 & 0xFF);
   color_b = float(color >> 8 & 0xFF);
   range_with_ratio = max_range * 1.6;

   if(numargs() > 4)
   {
      new out[145];
      va_format(out, 145, string, ___(4));

      foreach (new i : Player)
      {
         if (!IsPlayerStreamedIn(i, playerid)) {
            continue;
         }

         range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
         if (range > max_range) {
            continue;
         }

         range_ratio = (range_with_ratio - range) / range_with_ratio;
         clr_r = floatround(range_ratio * color_r);
         clr_g = floatround(range_ratio * color_g);
         clr_b = floatround(range_ratio * color_b);

         SendClientMessage(i, (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), out);
      }
      SendClientMessage(playerid, color, out);
   }
   else
   {
      foreach (new i : Player)
      {
         if (!IsPlayerStreamedIn(i, playerid)) {
            continue;
         }

         range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
         if (range > max_range) {
            continue;
         }

         range_ratio = (range_with_ratio - range) / range_with_ratio;
         clr_r = floatround(range_ratio * color_r);
         clr_g = floatround(range_ratio * color_g);
         clr_b = floatround(range_ratio * color_b);

         SendClientMessage(i, (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), string);
      }
      SendClientMessage(playerid, color, string);
   }
   return 1;
}[/pawn]
- Opis: Automatski menja boju (samo 1 boja se unosi, ne 5 kao u UP/SA/ATH....) u zavisnosti od udaljenosti igraca (kao ProxDetector obican samo automatski odradi posao)
- Dodatak: Ako imate ProxDetecotr f-ju vec u modu (koja trazi 5 boja), evo Regex da brzo to sredit
Find:
ProxDetector\((.*?),(.*?),(.*?),(.*?),.*?,.*?,.*?.*?\)
Replace u: ProxDetector($2, $1, $4, $3)
I posle ako bude 2 razmaka posle zareza samo replace ',  ' u ', ' (bez ')
- Credits: ziggi, trixy a.k.a Makenzi


Citat: Kriso poslato Februar 12, 2020, 17:09:44 POSLE PODNE
Mislim da si pogresio,
stock PlayerTextDrawSetStringEx(playerid, PlayerText:text, const string[], {Float,_}:...) {
   return PlayerTextDrawSetString(playerid, PlayerText:text, va_return(string, ___(2)))
}
ovde ide  va_return(string, ___(3))), jel tako? Dobro si me naucio hahahah
Greska, prepravio je Alex, CLICK

- Vase ime na forumu: Nodze
- Komanda x Funkcija :[pawn]
new Text3D:Zaginuli;
new Zaginuli = 1;

public OnGameModeInit()
{

   Zaginuli = Create3DTextLabel("{FFFFFF}Broj umrlih od zadnjeg updatea: 0",0xFF9900AA, 1715.8556,-1911.9867,14.2944, 20,0,1);
   return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new string[258];
   format(string, sizeof(string), "{FFFFFF}Broj umrlih od zadnjeg updatea: %d", Zaginuli);
   Update3DTextLabelText(Zaginuli, 0xFFFFFFFF, string);
   Zaginuli ++;
   return 1;
}[/pawn]
- Opis: Pregled u ingame koliko je ubijeno igraca od zadnjeg update-a
- Dodatak: mozda je bolje u TD bilo, ovo je iz dosade (CORONA)
- Credits: Nodze

- Slike: Nije potrebno
Poslednja Izmena: April 06, 2020, 14:39:24 POSLE PODNE od Nodze

Gamemod: Spotify Community
Owner: Nodze ( Dzenan Levic )

- Vase ime na forumu: Vasic
- Komanda x Funkcija:
[pawn]CMD:srecniid( playerid, params[ ] )
{
    //ovde stavite Vasu proveru da li je igrac admin | ex. if( PlayerInfo[ playerid ][ Administrator ] < 1 ) return SendClientMessage( playerid, -1, "Niste ovlasteni." );
    new onlineIgraci[ MAX_PLAYERS ], igraciCountOnline, srecniIDIme[ 24 ], str[ 156 ];
    for(new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( IsPlayerConnected( i ) )
        {
            onlineIgraci[ igraciCountOnline ] = i;
            igraciCountOnline++;
        }
    }
    GetPlayerName( onlineIgraci[ random( igraciCountOnline ) ], srecniIDIme, sizeof( srecniIDIme ) );
    format( str, sizeof( str ), "{22CE0F}(( SRECNI ID )) - {FFFFFF}Izvucen je ID {22CE0F}%d{FFFFFF} pod kojim se nalazi igrac {22CE0F}%s{FFFFFF}. CESTITKE!!!", onlineIgraci[ random( igraciCountOnline ) ], srecniIDIme );
    SendClientMessageToAll( -1, str );
    return 1;
}[/pawn]

- Opis: Komanda koja izvlaci random id jednog konektovanog igraca i ime koje taj id nosi, dole imate sliku.
- Dodatak: Nema
- Credits: Benjo
- Slike:
• Website: www.vasic.dev
Web Development & Cyber Security