Jump to content
  • 0

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


Question

Posted (edited)

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

4 answers to this question

Recommended Posts

Posted

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

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...