Looks like the admin of the forum prefer to warn people than help them, but to those want to know i found it on pc.c the function is
bool pc_equipitem(struct map_session_data *sd,short n,int req_pos)
Well, to make the official way it's get hard, but you can do it as NPC way, players drop the weapon and go to a NPC to get the options, it's a better way since you need only to create group 1, 2 and 3 and in the npc make it random
I made alot of changes on the script hahaha I will show it to you soon, including the progressbar
@Community
I got answer for all my questions here they are:
I did this to solve the problem:
OnInit:
bindatcmd("tokens" ,"TokensFunc::OnTokens",0,99);
end;
OnTokens:
@opcao = atoi(.@atcmd_parameters$[0]);
@desc = atoi(.@atcmd_parameters$[1]);
if(.@atcmd_parameters$[0] == "entrar") @opcao = 1;
if(.@atcmd_parameters$[0] == "info") @opcao = 2;
if(.@atcmd_parameters$[0] == "trocar") @opcao = 3;
if(.@atcmd_parameters$[0] == "sair") @opcao = 4;
switch(@opcao){
case 1:
"script"
end;
FYI: dont use "case 0:" because the .@atcmd_parameters$[0] always come as 0 (idk why but it is okay)
@Kurofly helped me with this and teach me this:
- script pvpexit -1,{
OnInit:
.TimeToExit = 5; //amount of time before exiting (in seconds)
bindatcmd "exit",strnpcinfo(0)+"::OnExit";
end;
OnExit:
dispbottom "You will exit the map after "+.TimeToExit+" seconds if you're not hurt.";
@prev_hp = Hp;
addtimer 100,strnpcinfo(0)+"::OnTimer";
end;
OnTimer:
@exittimer++;
if (Hp < @prev_hp) { dispbottom "You've been hit! exitting cancel..." ; end; }
@prev_hp = Hp;
if (@exittimer >= .TimeToExit*10) { @exittimer = 0 ; warp getsavepoint(0),getsavepoint(1),getsavepoint(2) ; end; }
addtimer 100,strnpcinfo(0)+"::OnTimer";
}