basically, all you would have to do is see the man page for ping.
Code:
ping -c $count -t $time_to_live $host_name
so in the script that you are writing, you could first either assign $count whatever value you want, or ask for user input. this argument should be in there otherwise ping will go on for a while. take userinput for the -t flag and store it in $time_to_live
and finally define the $host_name of the machine to be pinged.
to take command line arguments with bash, go to tldp.org and search for the advanced bash shell scripting guide.