Yrian09/03/2013 15:36:32Wenas gente, soy nuevo por aqui.Necesito ayuda para compilar dos scripts, es en referencia a los levels de 41 a 60, todos los scripts me funcionan bien, pero tengo otro ya en el Onleave del server y necesito compilar dos scripts en uno si pudierais ayudarme, no tengo mucha idea de scripts la verdad. El primero es este: include "nw_i0_plot" int index, iLev;string sLevels = "HP=" + IntToString( iLev ) + ";"; void SalvaConjuros(object oPC){ iLev = GetCurrentHitPoints( oPC ); for( index = 0; index < 622; index++ ) { iLev = GetHasSpell( index, oPC ); if ( iLev > 0 ) sLevels += "S" + IntToString( index ) + "=" + IntToString( iLev ) + ";"; } for( index = 0; index < 480; index++ ) { iLev = GetHasFeat( index, oPC ); if ( iLev > 0 ) sLevels += "F" + IntToString( index ) + "=" + IntToString( iLev ) + ";"; } SetCampaignString(GetModuleName(), GetName( oPC ) + "Levels", sLevels );} void main(){ object oPC = GetExitingObject(); string sRIP = ObjectToString(GetModule()); RemoveEffect(oPC, EffectPolymorph(SPELL_POLYMORPH_SELF)); SetCampaignInt(sRIP, GetName(oPC), GetCurrentHitPoints(oPC)); SalvaConjuros(oPC);} Y el segundo es este: #include "hgll_func_inc" void main(){ object PC = GetExitingObject(); object M = GetModule(); string Script = GetLocalString(PC, "LetoScript"); if( Script != "" ) { SetLocalString(PC, "LetoScript", ""); LetoScript(Script); }} Gracias de antemano por si alguien puede ayudarme a compilarlos en 1 solo Cerril09/03/2013 16:03:56si quieres compilar los dos en uno vasta con usar la funcioón ExecuteScriptEstá un poquitin descolocado y no pones el nombre de los guiones así que el de arriba lo llamaré guión1 y el de abajo guión2, luego sustituyes guión2 por el nombre de tu guión... En el guión 1 veo que tienenes dos funciones, pues al final de la función main escribes la función execute de esta forma [code:1:97fde0694b] void main() { object oPC = GetExitingObject(); string sRIP = ObjectToString(GetModule()); RemoveEffect(oPC, EffectPolymorph(SPELL_POLYMORPH_SELF)); SetCampaignInt(sRIP, GetName(oPC), GetCurrentHitPoints(oPC)); SalvaConjuros(oPC); ExecuteScript(guión2, OBJECT_SELF); } [/code:1:97fde0694b] Recuerda que donde pone guión2, tienes que poner el que tienes tu. Yrian09/03/2013 18:07:16a ver voy a probar gracias por tu respuesta ahora te digo si me funcionaYrian09/03/2013 18:14:29Nada me da fallo en variable definida sin tipoMira el primer script se llama 0_tx_salida, el segundo script se llama hgll_client_exit lo he puesto asi pero me da el fallo: #include "nw_i0_plot" int index, iLev; string sLevels = "HP=" + IntToString( iLev ) + ";"; void SalvaConjuros(object oPC) { iLev = GetCurrentHitPoints( oPC ); for( index = 0; index < 622; index++ ) { iLev = GetHasSpell( index, oPC ); if ( iLev > 0 ) sLevels += "S" + IntToString( index ) + "=" + IntToString( iLev ) + ";"; } for( index = 0; index < 480; index++ ) { iLev = GetHasFeat( index, oPC ); if ( iLev > 0 ) sLevels += "F" + IntToString( index ) + "=" + IntToString( iLev ) + ";"; } SetCampaignString(GetModuleName(), GetName( oPC ) + "Levels", sLevels ); } void main() { object oPC = GetExitingObject(); string sRIP = ObjectToString(GetModule()); RemoveEffect(oPC, EffectPolymorph(SPELL_POLYMORPH_SELF)); SetCampaignInt(sRIP, GetName(oPC), GetCurrentHitPoints(oPC)); SalvaConjuros(oPC); ExecuteScript(hgll_client_exit, OBJECT_SELF); } AlthorDeMalavir09/03/2013 18:21:02Es que el nombre del script ha de estar entre comillasExecuteScript("hgll_client_exit", OBJECT_SELF); Yrian09/03/2013 18:22:03ahora si que si, gracias a los dos, muchas graciasCerril09/03/2013 22:47:04ups. fallo mio :P :oops: |