Jump to content

Tutorial - SCMf


DrooM.

Recommended Posts

SALUT, ASTAZI AM SA VA ARAT UN MIC AVANTAJ IN LIMBAJUL DE SCRIPTING PAWN.

PENTRU INCEPUT, DU-TE LA INCLUDE-URI. SI ADAUGAM ASTA >

#include <y_va.inc>

ACUM, MERGEM SA CREEM UN NOU STOCK >

stock SCMf( playerid, color, const string[ ], va_args<> ) {
	new string2[ 256 ]; va_format( string2, sizeof string2, string, va_start<3> );
	return SendClientMessage( playerid, color, string2 ); }

Acum am sa va arat cum se foloseste > 

// FORMAT MESSAGE.
CMD:test(playerid, params[]) {
	new string[128];
	format(string, sizeof string, "Numele meu este %s, si am dick-ul mare", GetName(playerid));
	SCM(playerid, COLOR_RED, string);
	return 1; }

// SMCf MESSAGE.

CMD:test(playerid, params[]) {
	SCMf(playerid, COLOR_RED, "Numele meu este %s si am dick-ul mare", GetName(playerid));
	return 1; }

Downlaod Y_VA.INC > http://www.filehost.ro/3172800870/y_va_inc/

 

Credite: EraSy. 

Edited by DrooM.
  • Haha 1
Link to comment
Share on other sites

Acum 30 minute, DrooM. a spus:

SALUT, ASTAZI AM SA VA ARAT UN MIC AVANTAJ IN LIMBAJUL DE SCRIPTING PAWN.

PENTRU INCEPUT, DU-TE LA INCLUDE-URI. SI ADAUGAM ASTA >


#include <y_va.inc>

ACUM, MERGEM SA CREEM UN NOU STOCK >


stock SCMf( playerid, color, const string[ ], va_args<> ) {
	new string2[ 256 ]; va_format( string2, sizeof string2, string, va_start<3> );
	return SendClientMessage( playerid, color, string2 ); }

Acum am sa va arat cum se foloseste > 


// FORMAT MESSAGE.
CMD:test(playerid, params[]) {
	new string[128];
	format(string, sizeof string, "Numele meu este %s, si am dick-ul mare", GetName(playerid));
	SCM(playerid, COLOR_RED, string);
	return 1; }

// SMCf MESSAGE.

CMD:test(playerid, params[]) {
	SCMf(playerid, COLOR_RED, "Numele meu este %s si am dick-ul mare", GetName(playerid));
	return 1; }

Downlaod Y_VA.INC > http://www.filehost.ro/3172800870/y_va_inc/

Dragut dar de ce sa folosesc 256 de caractere cand am nevoie de maxim 30 ? :D

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

1 hour ago, StR_Marian said:

Dragut dar de ce sa folosesc 256 de caractere cand am nevoie de maxim 30 ? :D

va_format( string2, strlen(string), string, va_start<3> );

Ar trebui să funcționeze (cred, n-am testat).

Postarea cred că ar trebui mutată la resurse scripting.

Edited by Kingsley 2.0
Link to comment
Share on other sites

22 hours ago, EraSy said:

Daca am ajuns copiat, inseamna ca e bine ce fac:

 image.png.a8f11ae76295ae076d482c0a64c43b37.png

Face si omu' o functie in gamemode-ul de la Eternal Times, ajunge pe net, sub exact acelasi format.

Frumos.

Fmm, de unde sa stiu ca e al tau, stai, acu bag credite..

Link to comment
Share on other sites

La 20.03.2018 la 21:36, StR_Marian a spus:

Dragut dar de ce sa folosesc 256 de caractere cand am nevoie de maxim 30 ? :D

Str_marian... exact cum e el.. in stare naturala..

Si daca ai nevoie de maxim 30, nu poti baga un parametru in plus functiei?(pui numele size) .. stai ca te-am pierdut de la parametru.. scz

Lasand ironiile si memoriile cu rezolvariile tale super smechere...  Cui ii pasa de cativa biti ram? Cel mai important e procesorul.. regula numaru 1 e sa ai iteratori... scurtezi considerabil timpul de execute.. adica inalturi iteratiile nefolositoare... Ai invatat azi ceva? cu placere.

 

Edited by Scriptery
  • Confused 1
Link to comment
Share on other sites

  • 2 weeks later...
La 21.03.2018 la 19:44, EraSy a spus:

Daca am ajuns copiat, inseamna ca e bine ce fac:

 image.png.a8f11ae76295ae076d482c0a64c43b37.png

Face si omu' o functie in gamemode-ul de la Eternal Times, ajunge pe net, sub exact acelasi format.

Frumos.

Copilaș, si tu mai esti scripter ma ?

http://forum.sa-mp.com/showthread.php?t=526494

Ai modificat si tu str cu string2 si e facuta de tine.

Link to comment
Share on other sites

Ceva mai simplu

#define     SCMM(%0,%1,%2,%3)         format(gString, sizeof(gString),%2,%3) && SCM(%0, %1, gString)

CMD:blablabla(playerid,parmams[]){
    SCMM(playerid, -1 ,"Bulagiu: %s", GetName(playerid));
    return 1;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.