Jump to content
  • 0

HELP! script that detect a player if he/she change equips equipped on uppper,middle,or lower HG


Lord Ganja

Question


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

Hello. I tried making a script which sets the looks of the player into nothing even when they are equipped with headgears.

Can anyone here modify this script or tell me what script should I use in order to detect a player if they try to change equips.

 

Thanks in advance!

 

look at this script:

 

-    script    autochange    -1,{
OnPCLoadMapEvent:
if (getgmlevel() > 0) end;
getmapxy(.@map$,.@x,.@y,0);
if(.@map$=="pvp_c_room")
attachnpctimer ""+strcharinfo(0)+"";
goto a_timer;
end;

a_timer:
initnpctimer;
end;

OnTimer1000:
    end;

OnTimer1100:
    <script that detects a player if they changed equip?>
    atcommand "@changelook 1 0";
    atcommand "@changelook 2 0";
    atcommand "@changelook 3 0";
        stopnpctimer;
        end;
    } else {
    goto a_timer;
    stopnpctimer;
    end;
    }

OnPCDieEvent:
    getmapxy(.@map$,.@x,.@y,0);
    if(.@map$=="pvp_c_room") stopnpctimer;
    end;

OnPCLogoutEvent:
    getmapxy(.@map$,.@x,.@y,0);
    if(.@map$=="pvp_c_room") stopnpctimer;
    end;
}

EDIT:

maybe anyone could provide a new and much better script. That would be much appreciated. Thanks! :)

Edited by Lord Ganja
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  116
  • Reputation:   3
  • Joined:  04/03/13
  • Last Seen:  

wake and bake.... /no1

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

when the script 1st running ... save the "equipment ID" into a temporary variable...example

.@equip_id = getequipid( <equipment slot> );

 

then....when the time come ... or whenever you want to check it..

if( .@equip_id != getequipid( <equipment slot> ) ){
	mes "Dame you changed equipments.";
}

 

refer getequipid

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

when the script 1st running ... save the "equipment ID" into a temporary variable...example

.@equip_id = getequipid( <equipment slot> );

 

then....when the time come ... or whenever you want to check it..

if( .@equip_id != getequipid( <equipment slot> ) ){
	mes "Dame you changed equipments.";
}

 

refer getequipid

Thanks Emistry. but, could you modify my script? I don't know where to put it in my script.

 

EDIT:

I came up with this script, but it doesn't work. would anyone help me with this? Thanks!

 

 

-    script    autochange    -1,{
OnPCLoadMapEvent:
if (getgmlevel() > 0) end;
getmapxy(.@map$,.@x,.@y,0);
if(.@map$=="pvp_c_room") {
    set .@equip_top, getequipid(EQI_HEAD_TOP);
    set .@equip_mid, getequipid(EQI_HEAD_MID);
    set .@equip_bot, getequipid(EQI_HEAD_LOW);
    attachnpctimer ""+strcharinfo(0)+"";
    goto a_timer;
    }
    end;

a_timer:
initnpctimer;
end;

OnTimer1000:
    end;

OnTimer1100:
if( .@equip_top != getequipid(EQI_HEAD_TOP) ) {
    set .@equip_top, getequipid(EQI_HEAD_TOP);
    atcommand "@changelook 1 0";
    goto a_timer;
    stopnpctimer;
    end;
    }

if( .@equip_mid != getequipid(EQI_HEAD_MID) ) {
    set .@equip_mid, getequipid(EQI_HEAD_MID);
    atcommand "@changelook 2 0";
    goto a_timer;
    stopnpctimer;
    end;
    }

if( .@equip_bot != getequipid(EQI_HEAD_LOW) ) {
    set .@equip_bot, getequipid(EQI_HEAD_LOW);
    atcommand "@changelook 3 0";
    goto a_timer;
    stopnpctimer;
    end;
        } else {
        goto a_timer;
        stopnpctimer;
        end;
    }

OnPCDieEvent:
    getmapxy(.@map$,.@x,.@y,0);
    if(.@map$=="pvp_c_room") stopnpctimer;
    end;


OnPCLogoutEvent:
    getmapxy(.@map$,.@x,.@y,0);
    if(.@map$=="pvp_c_room") stopnpctimer;
    end;
}
Edited by Lord Ganja
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

BUMP! *

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
Answer this question...

×   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...