I'm using this script to reward players online in a given period, eg every 1 hour online a player receives an item x. I configured and tested for 1 minute, NPC delivery just right, but when I'm with more than one account logged deliver it to them and announces the name of the two. I wish it were random and with 1 character only.
Sorry my bad english.
prontera,200,200,0 script teste_premiador 105,{
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
OnTimer60000:
set @minute, @minute + 1;
// testando com 1 minuto
if(@minute == 1){
set @minute,0;
while(1){
query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
attachrid .@aid;
getitem 607,10;
announce strcharinfo(0) +"Recebeu 10 frutos de Ygg no sorteio por estar 1 hora online", 0;
dispbottom "Você recebeu 10 frutos de ygg por jogar 1 hora.";
set @consecutive_hour, @consecutive_hour + 1;
break;
}
}
//aqui verifica se o jogador esta a 12 horas online e dá um premio melhor.
if(@consecutive_hour == 12) {
set @consecutive_hour,0;
while(1){
query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
attachrid .@aid;
getitem 607,100;
announce strcharinfo(0) +"Recebeu 100 frutos de Ygg no sorteio por estar 1 hora online", 0;
dispbottom "Você recebeu 100 frutos de ygg por jogar 1 hora.";
set @consecutive_hour, @consecutive_hour + 1;
break;
}
stopnpctimer;
initnpctimer;
end;
}
//terminou
Question
Cyrix
Reward NPC - Random Player
I'm using this script to reward players online in a given period, eg every 1 hour online a player receives an item x. I configured and tested for 1 minute, NPC delivery just right, but when I'm with more than one account logged deliver it to them and announces the name of the two. I wish it were random and with 1 character only.
Sorry my bad english.
Thx.
Edited by Cyrix2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.