Author Topic: Logged info and Ticks error  (Read 1029 times)

0 Members and 1 Guest are viewing this topic.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Logged info and Ticks error
« on: May 14, 2013, 10:55:35 am »
What is wrong? I'm trying to add changes to this script.
It is working;
Code: [Select]
procedure AppOnIdle(Ticks: integer);
begin
  if Ticks mod (2160 * 2) = 0 then begin
    WriteConsole(0, '!komutlar" yazarak komutları görebilirsin!', $F2F200 );
    WriteConsole(0, '!yardım komutu ile yardım alabilirsin!', $F2F200 );
    WriteConsole(0, '!tb yazarak tum becerileri gorebilirsin!', $33FFFF );
  end;
end;

I added this parameters;
Code: [Select]
procedure AppOnIdle(Ticks: integer);
begin
  if Ticks mod (2160 * 2) = 0 then begin
    WriteConsole(0, '!komutlar" yazarak komutları görebilirsin!', $F2F200 );
    WriteConsole(0, '!yardım komutu ile yardım alabilirsin!', $F2F200 );
    WriteConsole(0, '!tb yazarak tum becerileri gorebilirsin!', $33FFFF );
  end;
end;

var i: byte;
begin
crossfunc([],'zrpgcrashdetector.ResetCountdown');

for i := 1 to 32 do if getplayerstat(i,'active') = true then begin
if Ticks mod (3600 * 1) = 0 then if player[i].logged = false then textbox(i,' Giris Yapilmadi ',messages[snotloggedin],#6,'_','|','+',$ffcc4444);
if player[i].logged = false then begin
  WriteConsole(0, '!uyelik yazarak bilgi alabilirsin!'. $33FFFF );
  end;
end;

It doesnt work, I want add last parameters for who have not logged in. If you logged in, (first command) you see three messages on screen; problem is here that if you didnt logged in you will see the three messages + in last parameters, "!uyelik yazarak bilgi alabilirsin"...

More simply; if you logged in, you must see 3 messages;
!komutlar ..
!yardım ..
!tb ..
This commands valith for both

But if you didnt log in (and only this case), you must see 3 messages + more 1 message for just not logged in that;
!uyelik..

If you logged in, you will see 3 messages, if you didnt login you will see 4 messages..
I can't fix it, what is wrong?

EDIT: This parameters isn't in zrpg.pas, I created other script folder and typed otomsj.pas, there are 2 different script.
« Last Edit: May 14, 2013, 06:24:02 pm by MrHamsTR »
Is there anybody can write script?
Good, go and play soldat ^^

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Logged info and Ticks error
« Reply #1 on: May 14, 2013, 01:04:49 pm »
Code: [Select]
procedure AppOnIdle(Ticks: integer);
var i: byte;
begin

if Ticks mod (2160 * 2) = 0 then
 begin
if (player[i].logged = false) then
                WriteConsole(i, 'You are not logged in! Sign in to your account, to view more options', $F2F200 )
        else
WriteConsole(i, '!komutlar" yazarak komutlari görebilirsin!', $F2F200 );
WriteConsole(i, '!yardim komutu ile yardim alabilirsin!', $F2F200 );
WriteConsole(i, '!tb yazarak tum becerileri gorebilirsin!', $33FFFF );
end;

// ###########################################################

crossfunc([],'zrpgcrashdetector.ResetCountdown');


for i := 1 to 32 do
begin
if GetPlayerStat(i,'Active') = true then
begin
if Ticks mod (3600 * 1) = 0 then
begin
if (player[i].logged = false) then
begin
WriteConsole(i, '!uyelik yazarak bilgi alabilirsin!', $33FFFF );
textbox(i,' Giris Yapilmadi ',messages[snotloggedin],#6,'_','|','+',$ffcc4444);
end;
end;
end;
end;

If I have understood.
When a player logs in to your account, see (3 messages).
When a player doesn't log in to your account, see (last messages "Sign in to your account, to view more options").
I corrected a few things.

Not tested

Check this code.
« Last Edit: May 14, 2013, 01:14:26 pm by skrX »

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: Logged info and Ticks error
« Reply #2 on: May 14, 2013, 04:28:32 pm »
Hello skrX, thanks for message;
But it doesnt work :/

  • ScriptCore v2.4 loaded! Found 9 scripts...

Compiling admin fun -> fun.PAS...
 Compiling default -> Core.pas...
 Compiling default -> NetworkCore.pas...
 Compiling default -> AdminCore.pas...
Compiling nextmap -> nextmap.pas...
 Compiling otoumsj -> otomsj.pas...
 otoumsj -> [Error] (8:6): Unknown identifier 'player'
 Unable to find variable
Shutting down server...
Disconnected.
Is there anybody can write script?
Good, go and play soldat ^^

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Logged info and Ticks error
« Reply #3 on: May 15, 2013, 03:49:11 am »
@MrHamsTr
Where is array player?
This your script didn't have the basic parameters

You must add function check log.
Where is "textbox" procedure ?
crossfunc([],'zrpgcrashdetector.ResetCountdown'); with zrpg.pas ?
« Last Edit: May 15, 2013, 04:17:59 am by skrX »

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: Logged info and Ticks error
« Reply #4 on: May 15, 2013, 05:14:27 am »
Hey

Code: [Select]
procedure AppOnIdle(Ticks: integer);
var i,player: byte;
begin

if Ticks mod (2160 * 2) = 0 then
 begin
if (player[i].logged = false) then
                WriteConsole(i, 'You are not logged in! Sign in to your account, to view more options', $F2F200 )
        else
WriteConsole(i, '!komutlar" yazarak komutlari görebilirsin!', $F2F200 );
WriteConsole(i, '!yardim komutu ile yardim alabilirsin!', $F2F200 );
WriteConsole(i, '!tb yazarak tum becerileri gorebilirsin!', $33FFFF );
end;

// ###########################################################

crossfunc([],'zrpgcrashdetector.ResetCountdown');


for i := 1 to 32 do
begin
if GetPlayerStat(i,'Active') = true then
begin
if Ticks mod (3600 * 1) = 0 then
begin
if (player[i].logged = false) then
begin
WriteConsole(i, '!uyelik yazarak bilgi alabilirsin!', $33FFFF );
textbox(i,' Giris Yapilmadi ',messages[snotloggedin],#6,'_','|','+',$ffcc4444);
end;
end;
end;
end;

Try this ;D

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: Logged info and Ticks error
« Reply #5 on: May 15, 2013, 07:11:13 am »
Hey

Code: [Select]
procedure AppOnIdle(Ticks: integer);
var i,player: byte;
begin

if Ticks mod (2160 * 2) = 0 then
 begin
if (player[i].logged = false) then
                WriteConsole(i, 'You are not logged in! Sign in to your account, to view more options', $F2F200 )
        else
WriteConsole(i, '!komutlar" yazarak komutlari görebilirsin!', $F2F200 );
WriteConsole(i, '!yardim komutu ile yardim alabilirsin!', $F2F200 );
WriteConsole(i, '!tb yazarak tum becerileri gorebilirsin!', $33FFFF );
end;

// ###########################################################

crossfunc([],'zrpgcrashdetector.ResetCountdown');


for i := 1 to 32 do
begin
if GetPlayerStat(i,'Active') = true then
begin
if Ticks mod (3600 * 1) = 0 then
begin
if (player[i].logged = false) then
begin
WriteConsole(i, '!uyelik yazarak bilgi alabilirsin!', $33FFFF );
textbox(i,' Giris Yapilmadi ',messages[snotloggedin],#6,'_','|','+',$ffcc4444);
end;
end;
end;
end;


doesn't have to be this one?:
Sen Giriş yapmadınız! Diğer seçenekleri görmek için, hesabınıza oturum açın = You are not logged in! Sign in to your account, to view more options

Try this script is good about now ;D
« Last Edit: May 15, 2013, 07:12:58 am by rOy »

DarkCrusade

  • Guest
Re: Logged info and Ticks error
« Reply #6 on: May 15, 2013, 07:43:30 am »
rOy, are you trolling this poor guy?

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: Logged info and Ticks error
« Reply #7 on: May 16, 2013, 11:09:00 am »
@MrHamsTr
Where is array player?
This your script didn't have the basic parameters

You must add function check log.
Where is "textbox" procedure ?
crossfunc([],'zrpgcrashdetector.ResetCountdown'); with zrpg.pas ?

yes with zrpg.pas
array player with zrpg.pas too I guess.
Is there anybody can write script?
Good, go and play soldat ^^

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Logged info and Ticks error
« Reply #8 on: May 16, 2013, 03:05:15 pm »
Check this code, but  I don't know if that will be works.


Code: [Select]

type tplayer = record
logged: boolean;
end;

var
player: array[1..32] of tplayer;


function CheckLogin():boolean;
var i:byte;
begin
i := crossfunc([],'ads.showid');
result := player[i].logged;
end;


// ###########################################################
// ###########################################################


procedure AppOnIdle(Ticks: integer);
var i: byte;
begin

if Ticks mod (2160 * 2) = 0 then
 begin
if (player[i].logged = false) then
                WriteConsole(i, 'You are not logged in! Sign in to your account, to view more options', $F2F200 )
        else
WriteConsole(i, '!komutlar" yazarak komutlari görebilirsin!', $F2F200 );
WriteConsole(i, '!yardim komutu ile yardim alabilirsin!', $F2F200 );
WriteConsole(i, '!tb yazarak tum becerileri gorebilirsin!', $33FFFF );
end;

// ###########################################################


for i := 1 to 32 do
begin
if GetPlayerStat(i,'Active') = true then
begin
if Ticks mod (3600 * 1) = 0 then
begin
if (player[i].logged = false) then
begin
WriteConsole(i, '!uyelik yazarak bilgi alabilirsin!', $33FFFF );
textbox(i,' Giris Yapilmadi ',messages[snotloggedin],#6,'_','|','+',$ffcc4444);
end;
end;
end;
end;

Why are you doing a separate script? It's easier to add this code to script zrpg (this code from AppOnIdle)

Simple.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: Logged info and Ticks error
« Reply #9 on: May 16, 2013, 04:05:15 pm »
It's boring, thank you for messages.. I wont't try change and success anymore.
Is there anybody can write script?
Good, go and play soldat ^^