Jump to content
Sign in to follow this  
thanna

[Atcommand]Dance

Recommended Posts

Hi! I converted this source mod to a plugin to avoid conflict with incoming updates, one of the most unique feature hercules have is HPM

 

Note: The code of @dance isn't mine, credit goes to the owner , I just converted it to a plugin for Hercules

 

Heres the code:

#include <stdio.h>#include <string.h>#include "../common/HPMi.h"#include "../map/script.h"#include "../map/pc.h" HPExport struct hplugin_info pinfo ={    "@dance",		// Plugin name    SERVER_TYPE_MAP,// Which server types this plugin works with?    "0.1a",			// Plugin version    HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)}; ACMD(dance){        if (!message || !*message) {		  clif->message(fd, "usage: @dance 1-9");return -1;   }   if ( atoi(message) == 1 ) {clif->specialeffect(&sd->bl, 413, ALL_CLIENT);   } else if ( atoi(message) == 2 ) {clif->specialeffect(&sd->bl, 414, ALL_CLIENT);   } else if ( atoi(message) == 3 ) {clif->specialeffect(&sd->bl, 415, ALL_CLIENT);   } else if ( atoi(message) == 4 ) {clif->specialeffect(&sd->bl, 426, ALL_CLIENT);   } else if ( atoi(message) == 5 ) {clif->specialeffect(&sd->bl, 458, ALL_CLIENT);   } else if ( atoi(message) == 6 ) {clif->specialeffect(&sd->bl, 466, ALL_CLIENT);   } else if ( atoi(message) == 7 ) {clif->specialeffect(&sd->bl, 501, ALL_CLIENT);   } else if ( atoi(message) == 8 ) {clif->specialeffect(&sd->bl, 540, ALL_CLIENT);   } else if ( atoi(message) == 9 ) {clif->specialeffect(&sd->bl, 550, ALL_CLIENT);   }	else	{	clif->message(fd, "usage: @dance 1-9");	 }   return true;} /* Server Startup */HPExport void plugin_init (void){    clif = GET_SYMBOL("clif");    script = GET_SYMBOL("script");    skill = GET_SYMBOL("skill");     HPMi->addCommand("dance",ACMD_A(dance));}
If you don't know to make/add a plugin follow this link

 

http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC

Edited by thanna

Share this post


Link to post
Share on other sites

as Ind said:

 

 

 This guide is probably the worst I've ever written, if you can do better please hit the 'Edit' button, will be most welcome. - Ind

 

pls do so, T_T

Share this post


Link to post
Share on other sites

have error in hercules 2015

 

1>------ Operación Generar iniciada: proyecto: plugin-dance, configuración: Release Win32 ------
1>Compilación iniciada a las 24-04-2015 22:33:42.
1>InitializeBuildStatus:
1>  Se creará "plugin-danceplugin-dance.unsuccessfulbuild" porque se especificó "AlwaysCreate".
1>ClCompile:
1>  dance.c
1>..srcpluginsdance.c(56): warning C4013: 'ACMD_A' sin definir; se supone que extern devuelve como resultado int
1>..srcpluginsdance.c(56): error C2065: 'dance' : identificador no declarado
1>..srcpluginsdance.c(56): warning C4047: 'función' : 'bool (__cdecl *)(const int,map_session_data *,const char *,const char *,AtCommandInfo *)' es distinto en los niveles de direccionamiento indirecto de 'int'
1>..srcpluginsdance.c(56): warning C4024: 'función mediante puntero' : tipos distintos para el parámetro formal y el parámetro real 2
1>
1>ERROR al compilar.
1>
1>Tiempo transcurrido 00:00:00.54
========== Generar: 0 correctos, 1 incorrectos, 0 actualizados, 0 omitidos ==========

Share this post


Link to post
Share on other sites
dance.c: In function 'atcommand_dance':dance.c:23:4: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]dance.c: In function 'plugin_init':dance.c:56:5: warning: implicit declaration of function 'ACMD_A' [-Wimplicit-function-declaration]dance.c:56:37: error: 'dance' undeclared (first use in this function)dance.c:56:37: note: each undeclared identifier is reported only once for each function it appears indance.c: At top level:dance.c:15:1: warning: 'atcommand_dance' defined but not used [-Wunused-function]make[1]: *** [../../plugins/dance.so] Error 1make[1]: Leaving directory `/home/roxx/Hercules/src/plugins'make: *** [plugins] Error 2

I have this error in linux :(

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.