Jump to content

Question

Posted (edited)

Hello.

Before everything, i must say that i'm a newbie on scripts. (in this language, english, too XD )

So, what am i trying to do?

I wanna a npc who says how much times u have logged in.

But i'm newbie, so i take a different script as source for this job.

And thats is the result:

--

dispbottom "You already logged ""query_sql ("SELECT `logincount` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);"" times.";

--

But something on this line is wrong, must have the ; but it is there.

And, if that script is wrong, you're free to correct/teach me. :D

Help me please. XD

Edited by jivagotupa

5 answers to this question

Recommended Posts

Posted (edited)

Instead of going the MySQL way, I've created something easier for you.


- script LoginCount -1,{
OnPCLoginEvent:
set LoginCount,LoginCount+1;
dispbottom "You have logged in "+LoginCount+" times!";
end;
}

Oh! Forgot about the login count. Hold on, I'll try it right now.

Try this one

- script LoginCount -1,{
query_sql "SELECT `logincount` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@login;
dispbottom "You have logged in "+@login+" times.";
end;
}

Edited by Nipsino
Posted

I'll try, thanks. :D

It does not work man. :/

Everytime it shows 0 on logincount

I'll be my specific about my objective. I'm trying to do a script that will give a item to a newbie, on his first login. But, after that, it will show then how many times he logged in and another things that does not matter now.

I try this one:

query_sql "SELECT `logincount` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@login;

OnPCLoginEvent:

if ("@login" <1) goto novo;

dispbottom "Você já logou "+@login+" vezes.";

end;

novo:

getitem 607,1;

dispbottom "Você já logou "+@login+" vezes.";

end;

and this

OnPCLoginEvent:

set LoginCount,LoginCount+1;

if ("+LoginCount+" <1) goto novo;

dispbottom "You have logged in "+LoginCount+" times!";

end;

novo:

mes "oi";

close;

Both of them shows 0 on the login count every time.

Somebody know what is us mistake?

sry by my english XD

Posted

actually you dont need a new variable...the server itself already got record for it.

query_sql( "SELECT `logincount` FROM `login` WHERE `account_id` ='"+getcharid(3)+"'",.@logincount );
dispbottom "You have logged in "+.@logincount+" times.";

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...