Raised This Month: $ Target: $400
 0% 

[ES] Existe el signo eleveado a ...?


  
 
 
Thread Tools Display Modes
Author Message
g_often
Senior Member
Join Date: Jan 2010
Location: In your mind
Old 06-14-2010 , 04:08   [ES] Existe el signo eleveado a ...?
#1

Hola a todos, quería saber si existe el signo "elevado", es para hacer por ejemplo, (elevado a la cuarta, etc ).

Gracias de antemano =)
__________________
Reality is wrong, dreams are for real.
g_often is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-14-2010 , 06:12   Re: [ES] Existe el signo eleveado a ...?
#2

No se si hay una funcion para eso... pero recien hice un stock, no lo testie asi que probalo:

Code:
#include <amxmodx> #define PLUGIN  "Elevacion a la Potencia" #define AUTHOR  "Alucard" #define VERSION "0.0.1" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_clcmd("say /elevate", "HookCmdElevate"); } public HookCmdElevate(id) {     new result = ElevationToPower(5, 2);     client_print(id, print_chat, "%d", result);         return PLUGIN_HANDLED; } stock ElevationToPower(base, exponent) {     if(exponent == 0)     {         if(base == 0)         {             set_fail_state("ElevationToPower(0 & 0)");             return 0;         }         else         {             log_amx("Cualquier numero de base elevado a 0 da 1");             return 1;         }     }         new result;     for(new i = 0; i < exponent; i++)     {         result = base * base;     }         return result; }

EDIT: Me cago en la p... .....

Code:
native power(value, exponent);

En core.inc

Cuando escribi el nombre del stock (ElevateToPower) el "power" me sono de algun lado pero no le di bola...
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 06-14-2010 at 06:18.
Alucard^ is offline
Send a message via Skype™ to Alucard^
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 06-14-2010 , 11:20   Re: [ES] Existe el signo eleveado a ...?
#3

Quote:
Originally Posted by Alucard^ View Post
No se si hay una funcion para eso... pero recien hice un stock, no lo testie asi que probalo:

Code:
#include <amxmodx> #define PLUGIN  "Elevacion a la Potencia" #define AUTHOR  "Alucard" #define VERSION "0.0.1" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_clcmd("say /elevate", "HookCmdElevate"); } public HookCmdElevate(id) {     new result = ElevationToPower(5, 2);     client_print(id, print_chat, "%d", result);         return PLUGIN_HANDLED; } stock ElevationToPower(base, exponent) {     if(exponent == 0)     {         if(base == 0)         {             set_fail_state("ElevationToPower(0 & 0)");             return 0;         }         else         {             log_amx("Cualquier numero de base elevado a 0 da 1");             return 1;         }     }         new result;     for(new i = 0; i < exponent; i++)     {         result = base * base;     }         return result; }

EDIT: Me cago en la p... .....

Code:
native power(value, exponent);

En core.inc

Cuando escribi el nombre del stock (ElevateToPower) el "power" me sono de algun lado pero no le di bola...
igual tu code esta mal no te preocupes xD!!
__________________
capostrike93 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-14-2010 , 11:37   Re: [ES] Existe el signo eleveado a ...?
#4

Quote:
Originally Posted by capostrike93 View Post
igual tu code esta mal no te preocupes xD!!
No te lo digo de mala onda pero... estaria bueno que digas el porque... la idea es aportar.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-14-2010 , 12:46   Re: [ES] Existe el signo eleveado a ...?
#5

Existe la función pow o power no me acuerdo bien
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-14-2010 , 12:47   Re: [ES] Existe el signo eleveado a ...?
#6

Quote:
Originally Posted by AntiBots View Post
Existe la función pow o power no me acuerdo bien
Sisi, fijate mi post al final =p
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-14-2010 , 13:09   Re: [ES] Existe el signo eleveado a ...?
#7

power.cpp :

PHP Code:
static cell power(AMX *amxcell *params)
{
    
/* power(value, exponent);
    *   params[1] = value
    *   params[2] = exponent
    */
    
    
cell result 1;
    while (
params[2]-- > 0)
        
result *= params[1];
    return 
result;

Lo que pasado a Pawn sería:
PHP Code:
stock poweriValueiExponent )
{
    new 
iResult 1;
    while ( 
iExponent-- > )
    {
        
iResult *= iValue;
    }
    return 
iResult;

Pero como ya dijeron es al pedo D:
__________________
"There is no knowledge, that is not power"

Last edited by fezh; 06-14-2010 at 13:31.
fezh is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-14-2010 , 13:21   Re: [ES] Existe el signo eleveado a ...?
#8

Lo iba a hacer con while tmb pero dsp cambie de idea xd...

Entonces lo que hice mal fue:

PHP Code:
result base base
Claro, deberia ser:

PHP Code:
result *= base
Porque si el exponente es 2 por ejemplo, de la forma que lo hice yo daria el resultado como si fuera un exponente de 3... no?

Te equivocaste fezh, en vez de:

PHP Code:
iResult *= iExponent
Es:

PHP Code:
iResult *= iValue
xd
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 06-14-2010 at 13:24.
Alucard^ is offline
Send a message via Skype™ to Alucard^
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 06-14-2010 , 13:51   Re: [ES] Existe el signo eleveado a ...?
#9

Es mucho mas interesante la siguiente native:
powerfloat() que permite usar exponentes decimales (Seria raro no hacerlo)
01101101 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-14-2010 , 14:08   Re: [ES] Existe el signo eleveado a ...?
#10

Igual, me podrian dar algun ejemplo en donde se podria usar esto? no se me ocurre ninguno. Bah, en realidad si se me ocurre una idea, pero no la voy a decir porque es un plugin que tengo pensado postear mas adelante =p, pero mas alla de ese no se me ocurre ningun otro uso que se le puede dar a power( ) o powerfloat( ).
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Old 06-14-2010, 14:18
Ayudanding
This message has been deleted by Ayudanding. Reason: client_print(id, print_chat, "5: %d", power(5, 2))
 



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 01:59.


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