Jump to content
  • 0

getcharip() with variable


nobukadnezar

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

Hello there,

 

I read the manual and other people script how to use getcharip with variable. But i don't know why does my script wont show the specified user name ip.

 

This is my test script:

 

prontera,156,178,3    script    IPcheck    952,{

    //input character name
    input .@Name$;    
    mes getcharip(.@Name$);

end;
}
 

 


 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Alternative : 

prontera,150,150,3    script    Sample    952,{
    //input character name
    input .@name$;
    mes getcharip(getcharid(3, .@name$));
    close;
}
  • Upvote 1
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:  

the name of the user input in the script ...must be an online player.

otherwise you have to use SQL run some query to get the result for offline users.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Either online or offline it doesn't return the ip address of a certain player. I made a test and the result is the image below :

 

 

post-7560-0-32380700-1383217083_thumb.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

I can't remember SQL tables used, but I believe you can simply query the IP to get it, if that command is broken.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

However when i put :

getcharip("Patskiee");

it returns 127.0.0.1 

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:  

@Patskie

you entered wrong name ?? hmm

 

DrPVOEH.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

No no, the script you show is the alternative i have made. It works fine because you pass the account id of an invoking player as an argument. what i mean is that when you try the script of the topic starter. it doesn't work even i input the online player name

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:  

i think it might be something wrong with the src side... or it's not coded correctly to accept players name directly.

should post at bug tracker.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

Alternative : 

prontera,150,150,3    script    Sample    952,{
    //input character name
    input .@name$;
    mes getcharip(getcharid(3, .@name$));
    close;
}

Thank you Patskie,  Emistry and Ryokem, it works.

As usual, you are awesome.

Edited by nobukadnezar
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...