Thanks to show me this option will be usefull
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(
[email protected]_parameters$[0]);
@desc = atoi(
[email protected]_parameters$[1]);
if(
[email protected]_parameters$[0] == "entrar") @opcao = 1;
if(
[email protected]_parameters$[0] == "info") @opcao = 2;
if(
[email protected]_parameters$[0] == "trocar") @opcao = 3;
if(
[email protected]_parameters$[0] == "sair") @opcao = 4;
switch(@opcao){
case 1:
"script"
end;
FYI: dont use "case 0:" because the
[email protected]_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";
}