Aaeria Posted June 26, 2017 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 12 Reputation: 0 Joined: 06/02/17 Last Seen: April 15, 2018 Share Posted June 26, 2017 I'm new to scripting and trying to make a basic petinfo command. But I get error, can someone help me to right way? This what I put so far: - script atcmds -1,{ OnInit: bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1"; end; OnAtcommand1: if( getpetinfo(PETINFO_ID()) == null ) { dispbottom "Sorry, you do not own a pet yet."; break; } else { dispbottom "[Pet] "+getpetinfo(petinfo_id())+""; end; } } Quote Link to comment Share on other sites More sharing options...
0 Deleted User Posted June 26, 2017 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Share Posted June 26, 2017 (edited) 24 minutes ago, Aaeria said: I'm new to scripting and trying to make a basic petinfo command. But I get error, can someone help me to right way? This what I put so far: - script atcmds -1,{ OnInit: bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1"; end; OnAtcommand1: if( getpetinfo(PETINFO_ID()) == null ) { dispbottom "Sorry, you do not own a pet yet."; break; } else { dispbottom "[Pet] "+getpetinfo(petinfo_id())+""; end; } } Try this. - script atcmds -1,{ OnInit: bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if( getpetinfo(PETINFO_NAME) == "null") { dispbottom "Sorry, you do not own a pet yet."; end; } else { dispbottom "=========== Information ==========="; dispbottom "ID: "+getpetinfo(PETINFO_ID)+""; dispbottom "Block ID: "+getpetinfo(PETINFO_BLOCKID)+""; dispbottom "Level: "+getpetinfo(PETINFO_LEVEL)+""; dispbottom "Class: "+getpetinfo(PETINFO_CLASS)+""; dispbottom "Name: "+getpetinfo(PETINFO_NAME)+""; dispbottom "Hungry: "+getpetinfo(PETINFO_HUNGRY)+""; dispbottom "Renamed: "+getpetinfo(PETINFO_RENAMED)+""; end; } } Edited June 26, 2017 by Kaze 1 Quote Link to comment Share on other sites More sharing options...
0 Aaeria Posted June 26, 2017 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 12 Reputation: 0 Joined: 06/02/17 Last Seen: April 15, 2018 Author Share Posted June 26, 2017 (edited) 15 minutes ago, Kaze said: Try this. - script atcmds -1,{ OnInit: bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if( getpetinfo(PETINFO_NAME) == "null") { dispbottom "Sorry, you do not own a pet yet."; end; } else { dispbottom "=========== Information ==========="; dispbottom "ID: "+getpetinfo(PETINFO_ID)+""; dispbottom "Block ID: "+getpetinfo(PETINFO_BLOCKID)+""; dispbottom "Level: "+getpetinfo(PETINFO_LEVEL)+""; dispbottom "Class: "+getpetinfo(PETINFO_CLASS)+""; dispbottom "Name: "+getpetinfo(PETINFO_NAME)+""; dispbottom "Hungry: "+getpetinfo(PETINFO_HUNGRY)+""; dispbottom "Renamed: "+getpetinfo(PETINFO_RENAMED)+""; end; } } Thank you, it worked. ++ Appreciate it, learned from this. Here's the basic pet info if someone wants: - script atcmds -1,{ OnInit: bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1"; end; OnAtcommand1: if( getpetinfo(petinfo_name) == "null" ) { dispbottom "Sorry, you do not own a pet yet."; end; } else { dispbottom "[Pet Info] (Lv. "+getpetinfo(petinfo_level)+") Nickname: "+getpetinfo(petinfo_name)+" - Intimacy Score: "+getpetinfo(petinfo_intimate)+" - Hunger: "+getpetinfo(petinfo_hungry)+"%"; end; } } Edited June 26, 2017 by Aaeria Quote Link to comment Share on other sites More sharing options...
Question
Aaeria
I'm new to scripting and trying to make a basic petinfo command. But I get error, can someone help me to right way? This what I put so far:
- script atcmds -1,{ OnInit: bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1"; end; OnAtcommand1: if( getpetinfo(PETINFO_ID()) == null ) { dispbottom "Sorry, you do not own a pet yet."; break; } else { dispbottom "[Pet] "+getpetinfo(petinfo_id())+""; end; } }
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.