Jump to content
  • 0

Help on this script


Question

Posted

i want to gm search on global_reg_value . the variable is #2ndpas$

how can i do this. that search the #2ndpas$ variable ??

then the #2ndpas$ variable that the player set it will shown. how can i do this?


header ,{
mes "[ Forgot ]";
mes "Hi GM!";
mes "forgot a Player 2nd password?";
next;
switch(select("Yes:NO")){

case 1:
mes "[ Forgot ]";
mes "Please Input Account ID";
next;
input .@input$;
query_sql("SELECT `str` FROM `global_reg_value` WHERE `account_id` =  '"+escape_sql(.@input$)+"' LIMIT 1", .@account_id);

13 answers to this question

Recommended Posts

Posted

you cant save a String with a integer variable...

and a variable's name...shouldnt start with a integer...

if( query_sql("SELECT `str` FROM `global_reg_value` WHERE `account_id` =  '"+escape_sql(.@input$)+"' LIMIT 1", .@pass$ ) ){
mes "Password = ^FF0000"+.@pass$+"^000000";
}

Posted

shou

you cant save a String with a integer variable...

and a variable's name...shouldnt start with a integer...

if( query_sql("SELECT `str` FROM `global_reg_value` WHERE `account_id` =  '"+escape_sql(.@input$)+"' LIMIT 1", .@pass$ ) ){
mes "Password = ^FF0000"+.@pass$+"^000000";
}

should i change the .@pass$ to my variable? #2ndpas$

Posted
and a variable's name...shouldnt start with a integer...

well, if your cases did work..then just change the variable to ur variable...

i am just providing a sample ..

Posted (edited)

ah ok thx :D

and a variable's name...shouldnt start with a integer...

well, if your cases did work..then just change the variable to ur variable...

i am just providing a sample ..

if i type the player's account id. it doesn't show

but if i type my account id the variable is showing

..~~~~~~~~~~~

other player's variable doesn't show only my variable is showing.

Edited by bVersatile
Posted

Are you trying to obtain the value of the variable or just the variable itself?

input .@input;
query_sql("SELECT `value` FROM `global_reg_value` WHERE `account_id` ="+.@input+" AND `str`='#2ndpas$' LIMIT 1", .@value$);
mes .@value$;

Posted

Are you trying to obtain the value of the variable or just the variable itself?

input .@input;
query_sql("SELECT `value` FROM `global_reg_value` WHERE `account_id` ="+.@input+" AND `str`='#2ndpas$' LIMIT 1", .@value$);
mes .@value$;

im gonna try it :D

Are you trying to obtain the value of the variable or just the variable itself?

input .@input;
query_sql("SELECT `value` FROM `global_reg_value` WHERE `account_id` ="+.@input+" AND `str`='#2ndpas$' LIMIT 1", .@value$);
mes .@value$;

how can i add escape sql on this?

Posted

Why do you need Escape sql?

can u help me here. i want to search account_id. if gm input is username that username account id will shown

is this correct?


case 2:
mes "[ ^008000Forgot System^000000 ]";
mes "Input the username!";
next;
input .@input2;
query_sql("SELECT `account_id` FROM `login` WHERE `userid` ="+.@input2+"  LIMIT 1", .@value2$);
mes "[ ^008000Forgot System^000000 ]";
mes "[^FF0000 "+.@input2+"^000000 ] Account ID [^0000FF "+.@value2$+"^000000 ]";
close;

Posted

You should use string variable for username.

input .@input2$;
query_sql("SELECT `account_id` FROM `login` WHERE `userid`='"+escape_sql(.@input2$)+"' LIMIT 1", .@aid);
mes "Account ID: "+.@aid;
close;

Posted (edited)

bVersatile just as a suggestion (that has nothing to do with your post) you should use the prompt command instead of select incase they click the cancel button. If you don't know what prompt is use the script_commands.txt in the doc folder.

Peopleperson49

Edited by peopleperson49
  • Upvote 1

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