Jump to content
  • 0

Help on this script


PewN

Question


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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);

Link to comment
Share on other sites

13 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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";
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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$

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

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$;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

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;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

thank you :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

You're welcome! xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

SolveD!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...