Pravila za Postavljanje Korisnih Komandi i Funkcija
1. Upotreba Code Taga:Sve komande i funkcije moraju biti postavljene unutar
2. Alternativno Korišćenje Pastebin/GitHub Linkova:Za duže komande ili funkcije preporučuje se postavljanje na Pastebin ili GitHub, a zatim deljenje linka u objavi.
Link mora biti jasan i direktan ka kodu.
3. Formular:Obavezno koristite navedeni formular za svaku objavu:
[b]- Komanda/Funkcija:[/b]
[b]- Opis:[/b]
[b]- Dodatak:[/b]
[b]- Credits:[/b]
[b]- Slike:[/b]
4. Pristojnost i Relevancija:Objave moraju biti relevantne za temu i korisne zajednici.
Zabranjeno je postavljanje spam sadržaja ili neprimerenih komentara.
5. Poštovanje Autorskih Prava:Ako koristite tuđe komande ili funkcije, obavezno navedite originalnog autora u delu "Credits".
6. Zabrana Modifikacija Formular:Ne menjajte standardni Formular postavljanja komandi i funkcija.
- 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:
(https://i.imgur.com/MPhjcKd.png)
- 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
- 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:(https://i.imgur.com/xCuo8jv.png)
(https://i.imgur.com/TQg9SBU.png)
(https://i.imgur.com/a3IkI3y.png)
- 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
- 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:
(https://i.ibb.co/Vx6yf7w/sa-mp-076.png)
- 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..
- 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 (https://github.com/pawn-lang/YSI-Includes/releases/tag/v5.1) ako nece da radi.
- Credits: Ja (Author), Y-Less (y_va)
- Slike: //
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 (https://github.com/pawn-lang/YSI-Includes/releases/tag/v5.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
[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 (https://github.com/pawn-lang/YSI-Includes/pull/405)
- 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
- 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:
(http://noobot.info/uploader/image.php?di=YAYX)
Zanimljivo :D
- VaÅ¡e ime na forumu: Zašto ovo moram da popunjavam???
[pawn]#include <YSI_Coding\y_va>
#include <YSI_Coding\y_utils>
#include <YSI_Data\y_iterate>
//#include <YSI_Players\y_groups>
CMD:srecniid(playerid, params[], help)
{
if(help)
{
SendClientMessage(playerid, -1, "Komanda koja random igracu daje nesto(?)");
}
else
{
new randomID = Iter_Random(Player);
/*
if(!Group_GetPlayer(Group: LoggedIn, randomID))
{
Command_ReProcess(playerid, "/srecniid", false);
return COMMAND_OK;
}
*/
va_SendClientMessageToAll(-1, "{22CE0F}(( SRECNI ID )) - {FFFFFF}Izvucen je ID {22CE0F}%d{FFFFFF} pod kojim se nalazi igrac {22CE0F}%s{FFFFFF}. CESTITKE!!!", randomID, ReturnPlayerName(randomID));
}
return COMMAND_OK;
}[/pawn]
- Opis: Komanda koja izvlaci random id jednog konektovanog igraca i ime koje taj id nosi, dole imate sliku.
- Dodatak: Listam malo forum i vidim ovo pa hajde da ispravim malo jer 99.99% (0.01% za Xundera) clanova ovog foruma koristi YSI
- Credits: Vasic i Benjo
- Slike:
(http://noobot.info/uploader/image.php?di=YAYX)
Citat: Alhemičar v2 poslato Avgust 03, 2020, 21:02:39 POSLE PODNE
- VaÅ¡e ime na forumu: Zašto ovo moram da popunjavam???
[pawn]#include <YSI_Coding\y_va>
#include <YSI_Coding\y_utils>
#include <YSI_Data\y_iterate>
//#include <YSI_Players\y_groups>
CMD:srecniid(playerid, params[], help)
{
if(help)
{
SendClientMessage(playerid, -1, "Komanda koja random igracu daje nesto(?)");
}
else
{
new randomID = Iter_Random(Player);
/*
if(!Group_GetPlayer(Group: LoggedIn, randomID))
{
Command_ReProcess(playerid, "/srecniid", false);
return COMMAND_OK;
}
*/
va_SendClientMessageToAll(-1, "{22CE0F}(( SRECNI ID )) - {FFFFFF}Izvucen je ID {22CE0F}%d{FFFFFF} pod kojim se nalazi igrac {22CE0F}%s{FFFFFF}. CESTITKE!!!", randomID, ReturnPlayerName(randomID));
}
return COMMAND_OK;
}[/pawn]
- Opis: Komanda koja izvlaci random id jednog konektovanog igraca i ime koje taj id nosi, dole imate sliku.
- Dodatak: Listam malo forum i vidim ovo pa hajde da ispravim malo jer 99.99% (0.01% za Xundera) clanova ovog foruma koristi YSI
- Credits: Vasic i Benjo
- Slike:
(http://noobot.info/uploader/image.php?di=YAYX)
Druze koji je tebi kurac , idi bre vise u picku materinu.
Druze ja samo pokusavam da pomognem, ne kazem da je
@Vasic bilo sta lose uradio samo zelim da ljudi vide kako jos moze da se uradi jer nisam napisao odgovor zbog toga sto je kod los nego sam hteo da demonstriram Iter_Random i Y_Groups ali dobro...
A za ovakve komentare trazim kaznu jer se decko gubi u svakoj temi
@SlavicBeast @CADILAB EDIT: 5 minuta saljem poruku Greske u bazi jebem ti forum retardirani
Citat: Alhemičar v2 poslato Avgust 03, 2020, 21:09:32 POSLE PODNE
Druze ja samo pokusavam da pomognem, ne kazem da je @Vasic bilo sta lose uradio samo zelim da ljudi vide kako jos moze da se uradi jer nisam napisao odgovor zbog toga sto je kod los nego sam hteo da demonstriram Iter_Random i Y_Groups ali dobro...
A za ovakve komentare trazim kaznu jer se decko gubi u svakoj temi @SlavicBeast @CADILAB
EDIT: 5 minuta saljem poruku Greske u bazi jebem ti forum retardirani
Ako neko treba da bude kaznjen onda si to ti balavce iskompleksirani koji mislis da si POVUKAO BOGA ZA KURAC , na svakoj temi ti nadjes neku zamerku , ako mislis da mi ne znamo da smo glupi PA KOJI KURAC onda trazis ovde , idi na official samp forum idi na bunglee gde vec hoces samo se tornjaj vise.
Izmeni spisak ignorisanja
Ime Status Imejl ICQ AIM YIM MSN
Ƭ H Σ Ʋ 1 ∏ ∏ Ψ _ Na mreži Imejl
Sporstki pozdrav!
I da dodam da koristim 4 samp foruma tako da ne brini se ti za mene :D
Citat: Alhemičar v2 poslato Avgust 03, 2020, 21:02:39 POSLE PODNE
- VaÅ¡e ime na forumu: Zašto ovo moram da popunjavam???
[pawn]#include <YSI_Coding\y_va>
#include <YSI_Coding\y_utils>
#include <YSI_Data\y_iterate>
//#include <YSI_Players\y_groups>
CMD:srecniid(playerid, params[], help)
{
if(help)
{
SendClientMessage(playerid, -1, "Komanda koja random igracu daje nesto(?)");
}
else
{
new randomID = Iter_Random(Player);
/*
if(!Group_GetPlayer(Group: LoggedIn, randomID))
{
Command_ReProcess(playerid, "/srecniid", false);
return COMMAND_OK;
}
*/
va_SendClientMessageToAll(-1, "{22CE0F}(( SRECNI ID )) - {FFFFFF}Izvucen je ID {22CE0F}%d{FFFFFF} pod kojim se nalazi igrac {22CE0F}%s{FFFFFF}. CESTITKE!!!", randomID, ReturnPlayerName(randomID));
}
return COMMAND_OK;
}[/pawn]
- Opis: Komanda koja izvlaci random id jednog konektovanog igraca i ime koje taj id nosi, dole imate sliku.
- Dodatak: Listam malo forum i vidim ovo pa hajde da ispravim malo jer 99.99% (0.01% za Xundera) clanova ovog foruma koristi YSI
- Credits: Vasic i Benjo
- Slike:
(http://noobot.info/uploader/image.php?di=YAYX)
Samo sam dosao da pitam gdje si izvukao ovo > 0.01% za Xundera < da ne koristim YSI?
Iako bi tvoj radio i sa standalone foreachom xD
Citat: // xunder poslato Avgust 04, 2020, 02:29:56 PRE PODNE
Samo sam dosao da pitam gdje si izvukao ovo > 0.01% za Xundera < da ne koristim YSI?
Iako bi tvoj radio i sa standalone foreachom xD
Radio bi ali YSI5 je mnogo brži hehe
I da dodam da koristim util iz y_utils-a i pod komentarom je y_groups iz gasa
Citat: Alhemičar v2 poslato Avgust 03, 2020, 21:09:32 POSLE PODNE
Druze ja samo pokusavam da pomognem, ne kazem da je @Vasic bilo sta lose uradio samo zelim da ljudi vide kako jos moze da se uradi jer nisam napisao odgovor zbog toga sto je kod los nego sam hteo da demonstriram Iter_Random i Y_Groups ali dobro...
A za ovakve komentare trazim kaznu jer se decko gubi u svakoj temi @SlavicBeast @CADILAB
EDIT: 5 minuta saljem poruku Greske u bazi jebem ti forum retardirani
Ja vojim jini i nemoj da me smaras ! Uh!
Citat: Alhemičar v2 poslato Avgust 04, 2020, 02:31:13 PRE PODNE
Radio bi ali YSI5 je mnogo brži hehe
I da dodam da koristim util iz y_utils-a i pod komentarom je y_groups iz gasa
Mnogo brzi y_iterate od foreach? :| :-X
Citat: // xunder poslato Avgust 04, 2020, 02:34:15 PRE PODNE
Mnogo brzi y_iterate od foreach? :| :-X
Nisam testirao, kažem da je YSI sam po sebi brz pa verujem da je brži od standalone foreacha koji nije updatean 4 godine
Ne mora da znači tho ali je standalone foreach unsupported
Citatforeach standalone include (non y_iterate version)
Y_Less dropped support for this version of foreach.
This version of foreach is 19 (0.4.3). This is the standalone version, so it does not require YSI. Use this version if you do not want to include YSI.
Ako je bitno toliko mogu da bencham sutra haha
Citat: Y-Less
If you see code doing this, it is a good way to tell that the code has not been touched in literally 10 years and should probably just be ignored. That has not been the correct way to use foreach in a VERY VERY VERY long time!
Citat: Alhemičar v2 poslato Avgust 04, 2020, 02:57:54 PRE PODNE
Nisam testirao, kažem da je YSI sam po sebi brz pa verujem da je brži od standalone foreacha koji nije updatean 4 godine
Ne mora da znači tho ali je standalone foreach unsupported
Ako je bitno toliko mogu da bencham sutra haha
Ne citas, opet cu pitati al eo malo capsa za bitne rijeci
MNOGO brzi?
A na telefonu sam jebiga, nije mnogo niti je primetno ali svakako zbog tog "malo" i zbog toga što po defaultu ima YSI iteratore za grupe i komande npr i iteratore u drugim bibliotekama je i više nego dovoljan razlog da ga koristim
Nikog ne silim da koristi YSI ovde
I ono što sam rekao da si ti 0.01% nije bila uvreda no možeš shvatiti i kao pohvalu jer su balkanci danas nesposobni da urade nešto svoje pa je svaki mod edit
- Komanda x Funkcija: https://hastebin.com/arukotofiy.cs
- Opis: Jednostavan modul za konektovanje sa MySQL bazom podataka pomoću Environment Varijabli
- Dodatak: //
- Credits: Kennedy
Citat: Alhemičar v2 poslato Avgust 06, 2020, 14:24:16 POSLE PODNE
- Komanda x Funkcija: https://hastebin.com/arukotofiy.cs
- Opis: Jednostavan modul za konektovanje sa MySQL bazom podataka pomoću Environment Varijabli
- Dodatak: //
- Credits: Kennedy
Nisi trebao na hastebin jer se izbriše sam...
hook post:990306
{
- Komanda x Funkcija = https://pastebin.com/3BWnMZ5Q
}
- Vase ime na forumu: V01D
- Komanda x Funkcija : [pawn]GetWeekDay(day=0, month=0, year=0)
{
if (!day)
getdate(year, month, day);
new
weekday_str[16],
j,
e
;
if (month <= 2)
{
month += 12;
--year;
}
j = year % 100;
e = year / 100;
switch ((day + (month+1)*26/10 + j + j/4 + e/4 - 2*e) % 7)
{
case 0: weekday_str = "Subota";
case 1: weekday_str = "Nedelja";
case 2: weekday_str = "Ponedeljak";
case 3: weekday_str = "Utorak";
case 4: weekday_str = "Sreda";
case 5: weekday_str = "Cetvrtak";
case 6: weekday_str = "Petak";
}
return weekday_str;
}
//Upotreba :
va_SendClientMessage(playerid, 0x95b4a2FF, "Danas je %s", GetWeekDay());[/pawn]
- Opis: Na stranom forumu sam nasao funkciju koja vrati dan u nedelji, tako da sam preveo dane i primenio u svoju korist
- Dodatak: OVO NIJE MOJE!
- Credits: Nemam predstavu
- Slike: Ne trebaju
- Komanda x Funkcija :
[pawn]stock RemovePlayerWeapon(playerid, weaponid)
{
return SetPlayerAmmo(playerid, weaponid, 0);
}[/pawn]
- Opis: Video sam da mnogi koriste for loop(petlju) koja prolazi kroz svih 13 slotova i get-a pre toga weapon data i onda uporedjuje unutar loop-a ali evo jedna jako jednostavna a brza funkcija :D
- Dodatak: Nisam testirao jer nema baš šta da se testira... :D
- Credits: //
- Komanda x Funkcija:
/*
2019 - ChatBreaker Include v1.0. written by Logan
08/2020 - v1.1. - Added support for breaking/passing embedded colors in next chat line/row
*/
stock SendSplitMessage(playerid, color, const final[])
{
new len = strlen(final);
if(len >= 100)
{
new buffer[100],
colorstring[9] = EOS, colorstart = 0, colorend = 0,
buffer2[128], spacepos = 0, bool:broken = false;
for(new j = 60; j < len; j++)
{
if(final[j] == '{')
colorstart = j;
if(final[j] == '}')
colorend = j + 1;
if(final[j] == ' ')
spacepos = j;
if(j >= 90 && spacepos >= 60 && (colorstart == 0 || (colorstart != 0 && colorend > colorstart)))
{
broken = true;
if(colorstart != 0 && colorend != 0)
strmid(colorstring, final, colorstart, colorend, sizeof(colorstring));
strmid(buffer, final, 0, spacepos);
format(buffer, sizeof(buffer), "%s...", buffer);
SendClientMessage(playerid, color, buffer);
strmid(buffer2, final, spacepos+1, len);
format(buffer2, sizeof(buffer2), "%s...%s", colorstring, buffer2);
SendClientMessage(playerid, color, buffer2);
return 1;
}
}
if(!broken)
SendClientMessage(playerid, color, final);
}
else return SendClientMessage(playerid, color, final);
return 1;
}
stock SendSplitMessageToAll(color, const final[])
{
new len = strlen(final);
if(len >= 100)
{
new buffer[100],
colorstring[9] = EOS, colorstart = 0, colorend = 0,
buffer2[128], spacepos = 0, bool:broken=false;
for(new j = 60; j < len; j++)
{
if(final[j] == ' ')
spacepos = j;
if(final[j] == '{')
colorstart = j;
if(final[j] == '}')
colorend = j + 1;
if(j >= 90 && spacepos >= 60 && (colorstart == 0 || (colorstart != 0 && colorend > colorstart)))
{
broken = true;
if(colorstart != 0 && colorend != 0)
strmid(colorstring, final, colorstart, colorend, sizeof(colorstring));
strmid(buffer, final, 0, spacepos);
format(buffer, sizeof(buffer), "%s...", buffer);
SendClientMessageToAll(color, buffer);
strmid(buffer2, final, spacepos+1, len);
format(buffer2, sizeof(buffer2), "%s...%s", colorstring, buffer2);
SendClientMessageToAll(color, buffer2);
return 1;
}
}
if(!broken)
SendClientMessageToAll(color, final);
}
else return SendClientMessageToAll(color, final);
return 1;
}
stock AC_SendClientMessageToAll(color, const message[])
{
SendSplitMessageToAll(color, message);
return 1;
}
#if defined _ALS_SendClientMessageToAll
#undef SendClientMessageToAll
#else
#define _ALS_SendClientMessageToAll
#endif
#define SendClientMessageToAll AC_SendClientMessageToAll
stock AC_SendClientMessage(playerid, color, const message[])
{
SendSplitMessage(playerid, color, message);
return 1;
}
#if defined _ALS_SendClientMessage
#undef SendClientMessage
#else
#define _ALS_SendClientMessage
#endif
#define SendClientMessage AC_SendClientMessage
- Opis: ChatBreaker v1.1 lomi SCM(ToAll) stringove duže od 100 znakova u 2 reda, nikada usred riječi, nego traži space da bi slomi od 60tog do 90tog znaka. Ukoliko ih ne nađe, ne razlama se string(što se gotovo nikad ne dešava, pošto su tako duge riječi VRLO rijetke). Prenosi i embedded({ FFFFFF }) boje u sljedeći red ukoliko postoje unutar stringa.
Citat: CoA|Logan poslato Avgust 31, 2020, 18:54:48 POSLE PODNE
- Komanda x Funkcija:
/*
2019 - ChatBreaker Include v1.0. written by Logan
08/2020 - v1.1. - Added support for breaking/passing embedded colors in next chat line/row
*/
stock SendSplitMessage(playerid, color, const final[])
{
new len = strlen(final);
if(len >= 100)
{
new buffer[100],
colorstring[9] = EOS, colorstart = 0, colorend = 0,
buffer2[128], spacepos = 0, bool:broken = false;
for(new j = 60; j < len; j++)
{
if(final[j] == '{')
colorstart = j;
if(final[j] == '}')
colorend = j + 1;
if(final[j] == ' ')
spacepos = j;
if(j >= 90 && spacepos >= 60 && (colorstart == 0 || (colorstart != 0 && colorend > colorstart)))
{
broken = true;
if(colorstart != 0 && colorend != 0)
strmid(colorstring, final, colorstart, colorend, sizeof(colorstring));
strmid(buffer, final, 0, spacepos);
format(buffer, sizeof(buffer), "%s...", buffer);
SendClientMessage(playerid, color, buffer);
strmid(buffer2, final, spacepos+1, len);
format(buffer2, sizeof(buffer2), "%s...%s", colorstring, buffer2);
SendClientMessage(playerid, color, buffer2);
return 1;
}
}
if(!broken)
SendClientMessage(playerid, color, final);
}
else return SendClientMessage(playerid, color, final);
return 1;
}
stock SendSplitMessageToAll(color, const final[])
{
new len = strlen(final);
if(len >= 100)
{
new buffer[100],
colorstring[9] = EOS, colorstart = 0, colorend = 0,
buffer2[128], spacepos = 0, bool:broken=false;
for(new j = 60; j < len; j++)
{
if(final[j] == ' ')
spacepos = j;
if(final[j] == '{')
colorstart = j;
if(final[j] == '}')
colorend = j + 1;
if(j >= 90 && spacepos >= 60 && (colorstart == 0 || (colorstart != 0 && colorend > colorstart)))
{
broken = true;
if(colorstart != 0 && colorend != 0)
strmid(colorstring, final, colorstart, colorend, sizeof(colorstring));
strmid(buffer, final, 0, spacepos);
format(buffer, sizeof(buffer), "%s...", buffer);
SendClientMessageToAll(color, buffer);
strmid(buffer2, final, spacepos+1, len);
format(buffer2, sizeof(buffer2), "%s...%s", colorstring, buffer2);
SendClientMessageToAll(color, buffer2);
return 1;
}
}
if(!broken)
SendClientMessageToAll(color, final);
}
else return SendClientMessageToAll(color, final);
return 1;
}
stock AC_SendClientMessageToAll(color, const message[])
{
SendSplitMessageToAll(color, message);
return 1;
}
#if defined _ALS_SendClientMessageToAll
#undef SendClientMessageToAll
#else
#define _ALS_SendClientMessageToAll
#endif
#define SendClientMessageToAll AC_SendClientMessageToAll
stock AC_SendClientMessage(playerid, color, const message[])
{
SendSplitMessage(playerid, color, message);
return 1;
}
#if defined _ALS_SendClientMessage
#undef SendClientMessage
#else
#define _ALS_SendClientMessage
#endif
#define SendClientMessage AC_SendClientMessage
- Opis: ChatBreaker v1.1 lomi SCM(ToAll) stringove duže od 100 znakova u 2 reda, nikada usred riječi, nego traži space da bi slomi od 60tog do 90tog znaka. Ukoliko ih ne nađe, ne razlama se string(što se gotovo nikad ne dešava, pošto su tako duge riječi VRLO rijetke). Prenosi i embedded({ FFFFFF }) boje u sljedeći red ukoliko postoje unutar stringa.
Sve top samo
else if umesto
if
Citat: King of the Jungle poslato Avgust 31, 2020, 18:59:07 POSLE PODNE
Sve top samo else if umesto if
U pravu si, na brzaka sam pisao pa ono. Uglavnom kod testiran i funkcionira :)
Vaše ime na forumu: Nodze
Komanda x Funkcija : Ping / FPS
[pawn]
#include <a_samp>
#include <YSI\y_timers>
new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
new Text3D:PlayerLabel[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
pDrunkLevelLast[playerid] = 0;
pFPS[playerid] = 0;
PlayerLabel[playerid] = Create3DTextLabel("_", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.75);
}
public OnPlayerDisconnect(playerid)
{
Delete3DTextLabel(PlayerLabel[playerid]);
return 1;
}
ptask asdasd[1000](playerid)
{
new drunknew;
drunknew = GetPlayerDrunkLevel(playerid);
if (drunknew < 100)
{
SetPlayerDrunkLevel(playerid, 2000);
}
else
{
if (pDrunkLevelLast[playerid] != drunknew)
{
new wfps = pDrunkLevelLast[playerid] - drunknew;
if ((wfps > 0) && (wfps < 200))
pFPS[playerid] = wfps;
pDrunkLevelLast[playerid] = drunknew;
}
}
//FPS/Ping
static tmp[128];
format(tmp, sizeof(tmp), "{FFFF00}FPS: {FF0000}%i\n{FFFF00}Ping: {FF0000}%i", pFPS[playerid], GetPlayerPing(playerid));
Update3DTextLabelText(PlayerLabel[playerid], 0xFFFFFFFF, tmp);
return 1;
}[/pawn]
Opis: FPS i PING (3D Text Label) , Lijepo za RP ili TDM
Dodatak:
Credits: Nodze
- Slike: Ne trebaju
- Vaše ime na forumu: Spejs
- Komanda x Funkcija :
[pawn]IsVehicleOccupied(vehicleid)
{
foreach (new i : VehicleOccupant[vehicleid]) {
return true;
}
return false;
}[/pawn]
- Opis: Vraća true ako je neko u vozilu (kao (su)vozač), false ako nije.
- Dodatak: Potrebna poslednja verzija YSIa
- Credits: Y_Less
Konvertovanje broja mnogo krace ;D
[pawn]FormatMoney(money)
{
new str[24],i;valstr(str,money),i=(money > 0) ? strlen(str)-3 : strlen(str)-4;
for(; i>0; i-=3) strins(str,".",(money > 0) ? i : i+1,24);
return str;
}[/pawn]
Citat: Fergosonn poslato Januar 04, 2023, 21:57:22 POSLE PODNE
Konvertovanje broja mnogo krace ;D
[pawn]FormatMoney(money)
{
new str[24],i;valstr(str,money),i=(money > 0) ? strlen(str)-3 : strlen(str)-4;
for(; i>0; i-=3) strins(str,".",(money > 0) ? i : i+1,24);
return str;
}[/pawn]
ili
https://github.com/thecodeah/pawn-humanize
- Vaše ime na forumu: Spejs
- Komanda x Funkcija :
[pawn]Float:GetVehicleSpeed(vehicleid, bool:kmh = true)
{
new
Float:vx,
Float:vy,
Float:vz,
Float:speed;
if(!GetVehicleVelocity(vehicleid, vx, vy, vz))
return 0.0;
speed = VectorSize(vx, vy, vz);
return kmh ? floatround(speed * 195.12) : floatround(speed * 121.30);
}[/pawn]
- Opis: Brzina vozila u km/h iki mp/h
Citat: Spejs poslato Januar 06, 2023, 14:14:11 POSLE PODNE
- Vaše ime na forumu: Spejs
- Komanda x Funkcija :
[pawn]Float:GetVehicleSpeed(vehicleid, bool:kmh = true)
{
new
Float:vx,
Float:vy,
Float:vz,
Float:speed;
if(!GetVehicleVelocity(vehicleid, vx, vy, vz))
return 0.0;
speed = VectorSize(vx, vy, vz);
return kmh ? floatround(speed * 195.12) : floatround(speed * 121.30);
}[/pawn]
- Opis: Brzina vozila u km/h iki mp/h
Fali ti tajmer od 1ms
Citat: Galardo poslato Januar 06, 2023, 14:39:11 POSLE PODNE
Fali ti tajmer od 1ms
Ja brzinomer pravim na vehicle sync paket ;D
- Vaše ime na forumu: deksyseksy emmett wajt
- Komanda x Funkcija :[pawn]stock SplitPlayerName(const playerid, const part[] = "name" /* part = name/lastname */)
{
new
name[MAX_PLAYER_NAME],
option;
GetPlayerName(playerid, name, sizeof(name));
option = (!strcmp(part, "name", false) ? 1 : !strcmp(part, "lastname", false) ? 2 : 0xFFFF);
for (new i = 0; i < sizeof(name); i++)
{
if (name == "_") // ovde umesto navodnika stavite apostrof
strdel(name, option == 1 ? i : -1, option == 1 ? sizeof(name) - 1 : i);
}
return name;
}[/pawn]
- Opis: Odvoji igracevo ime od '_'
- Dodatak: //
- Credits: //
- Slike://
Koristi se npr:
Moje ime na serveru je Emmett_White
[pawn]SplitPlayerName(playerid, "lastname");[/pawn]
izlaz: White
[pawn]SplitPlayerName(playerid, "name");[/pawn]
izlaz: Emmett
Citat: deksyseksy (mozda emmett?) poslato Februar 28, 2023, 22:23:31 POSLE PODNE
- Vaše ime na forumu: deksyseksy emmett wajt
- Komanda x Funkcija :[pawn]stock SplitPlayerName(const playerid, const part[] = "name" /* part = name/lastname */)
{
new
name[MAX_PLAYER_NAME],
option;
GetPlayerName(playerid, name, sizeof(name));
option = (!strcmp(part, "name", false) ? 1 : !strcmp(part, "lastname", false) ? 2 : 0xFFFF);
for (new i = 0; i < sizeof(name); i++)
{
if (name == "_") // ovde umesto navodnika stavite apostrof
strdel(name, option == 1 ? i : -1, option == 1 ? sizeof(name) - 1 : i);
}
return name;
}[/pawn]
- Opis: Odvoji igracevo ime od '_'
- Dodatak: //
- Credits: //
- Slike://
Koristi se npr:
Moje ime na serveru je Emmett_White
[pawn]SplitPlayerName(playerid, "lastname");[/pawn]
izlaz: White
[pawn]SplitPlayerName(playerid, "name");[/pawn]
izlaz: Emmett
https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Core/y_utils/y_utils_names.inc
a ne, ovo nema name surname, mb, mislio sam da ima njtf
Bump. Vraceno u zivot.