Raised This Month: $32 Target: $400
 8% 

Recopilación de códigos.


  
 
 
Thread Tools Display Modes
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 01-26-2012 , 15:51   Re: Recopilación de códigos.
#21

estaria bueno que pongamos los autores de cada stock.
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-27-2012 , 21:20   Re: Recopilación de códigos.
#22

Stock para escribir al revés.
Code:
stock reverse_string( const string[] = "" , Output[ ] ) {     static len; len = strlen( string ) - 1         for(new i ; i <= len; i++ )         Output[i] = string[ len - i ] }

Ex:
Code:
#include <amxmodx> public plugin_init() {     new MyString[ 192 ]         reverse_string( "hello world",  MyString )     server_print( "%s" , MyString ) } stock reverse_string( const string[] = "" , Output[ ] ) {     static len; len = strlen( string ) - 1         for(new i ; i <= len; i++ )         Output[i] = string[ len - i ] }
Output:
PHP Code:
dlrow olleh 
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 02-16-2012 at 11:15.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 01-30-2012 , 08:13   Re: Recopilación de códigos.
#23

Quote:
Originally Posted by lucas_7_94 View Post
Stock para escribir al revés.
Code:
stock reverse_string( const string[] = "" , Len , Output[ ] ) {     for(new i ; i <= Len - 1; i++ )         Output[i] = string[ ( Len - 1 ) -i ] }

Ex:
Code:
#include <amxmodx> public plugin_init() {     new MyString[ 192 ]         reverse_string( "hello world", strlen("hello world"), MyString )         server_print( "%s" , MyString ) } stock reverse_string( const string[] = "" , Len , Output[ ] ) {     for(new i ; i <= Len - 1; i++ )         Output[i] = string[ ( Len - 1 ) -i ] }
Output:
PHP Code:
dlrow olleh 
Code:
#include <amxmodx> public plugin_init() {     new out[50];     new pos = 0;     reverse_string( "olleh" , out, 0, pos += 5);     reverse_string( " ro " , out, 0, pos += 4);     reverse_string( "dlrow olleh" , out, 0, pos += 11);      server_print( "%s" , out ) } stock reverse_string( const src[] = "" , dest[ ], srcpos, destpos ) {     new srcLen = strlen(src)-srcpos;     new destEnd = destpos+srcLen;     if(destEnd > strlen(dest))     {         return;     }     for(new i = destpos; i < destEnd; i++)     {         dest[i] = src[--srcLen];     } }

en teoria tendria que funcionar
__________________

Last edited by capostrike93; 01-30-2012 at 08:21.
capostrike93 is offline
StickP0le
Senior Member
Join Date: Jan 2010
Location: cuantocabron.com
Old 01-30-2012 , 21:01   Re: Recopilación de códigos.
#24

y cual es la diferencia?
StickP0le is offline
fearAR
Veteran Member
Join Date: Oct 2010
Old 01-30-2012 , 22:45   Re: Recopilación de códigos.
#25

Si hubieras comprendido el codigo verias la diferencia.

El stock de capostrike permite definir desde que posicion hasta que posicion revertir el string.

Saludos.
__________________
~~~~ NPC AI ~~~~

[ Pathfinding - OK ]
[ Citizen AI - OK ]
[ Handle Weapons - --- ]
fearAR is offline
Send a message via MSN to fearAR
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 02-03-2012 , 18:31   Re: Recopilación de códigos.
#26

Quote:
Originally Posted by lucas_7_94 View Post
Stock para escribir al revés.
Code:
stock reverse_string( const string[] = "" , Len , Output[ ] ) {     for(new i ; i <= Len - 1; i++ )         Output[i] = string[ ( Len - 1 ) -i ] }

Ex:
Code:
#include <amxmodx> public plugin_init() {     new MyString[ 192 ]         reverse_string( "hello world", strlen("hello world"), MyString )         server_print( "%s" , MyString ) } stock reverse_string( const string[] = "" , Len , Output[ ] ) {     for(new i ; i <= Len - 1; i++ )         Output[i] = string[ ( Len - 1 ) -i ] }
Output:
PHP Code:
dlrow olleh 
Sería bueno que strlen esté dentro del stock, porque así no se ve muy bien.
__________________
Oh hell no this shit is awesome !!!
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-16-2012 , 08:47   Re: Recopilación de códigos.
#27

Fixeado RGB color y stock para escribir en reversa.-
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-16-2012 , 11:09   Re: Recopilación de códigos.
#28

Asi es mejor, lucas
PHP Code:
stock reverse_string( const string[] = "" Output[ ] )
{
    static 
lenlen strlen( string ) - 1
    
    
for(new <= leni++ )
        
Output[i] = stringlen ]

Si pones el strlen en el for, lo llama cada vez que aumente i, ya que vuelve a evaluar la expresion para ver si seguir con el bucle o no.
Y abajo, igual, no es necesario llamar strlen tantas veces como longitud tenga la cadena.

ZBUG
__________________
Javivi is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-16-2012 , 11:15   Re: Recopilación de códigos.
#29

que tiene que ver con zp lol , pero bueno , ok lo updateo.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-16-2012 , 11:20   Re: Recopilación de códigos.
#30

Quote:
Originally Posted by lucas_7_94 View Post
que tiene que ver con zp lol , pero bueno , ok lo updateo.
zbug no esta relacionado con el zp, zbug es una unidad de medida de bug
__________________
Javivi is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode